Unified OpenSearch PPL Data Type#3345
Conversation
Signed-off-by: Peng Huo <penghuo@gmail.com>
| static { | ||
| exprTypeToPPLType.put(ExprCoreType.BYTE, "tinyint"); | ||
| exprTypeToPPLType.put(ExprCoreType.SHORT, "smallint"); | ||
| exprTypeToPPLType.put(ExprCoreType.INTEGER, "int"); | ||
| exprTypeToPPLType.put(ExprCoreType.LONG, "bigint"); | ||
| } |
There was a problem hiding this comment.
Since this is a breaking change, why don't we directly change the old type to the new type, instead of introducing LangSpec? Isn't this unnecessarily adding complexity?
There was a problem hiding this comment.
I agree. The core type was not upgraded because I intended for the data type changes to affect only PPL and not SQL. This PR focuses on unifying PPL data types, while SQL data types can be addressed in a separate issue, as changes there would impact JDBC, ODBC, and CLI.
Ideally, the query engine should use well-defined data types, with LangSpec serving as the protocol for translating these engine types to language-specific types. Once the Calcite implementation is complete, CalciteDataType will translate to ExprDataType, and LangSpec will translate from ExprDataType to the PPL response data type.
Signed-off-by: Peng Huo <penghuo@gmail.com>
Signed-off-by: Peng Huo <penghuo@gmail.com>
Signed-off-by: Peng Huo <penghuo@gmail.com>
Signed-off-by: Peng Huo <penghuo@gmail.com>
...c/main/java/org/opensearch/sql/opensearch/request/system/OpenSearchDescribeIndexRequest.java
Show resolved
Hide resolved
Signed-off-by: Peng Huo <penghuo@gmail.com>
| */ | ||
| public interface LangSpec { | ||
| /** Enumerates the supported language types. */ | ||
| enum LangType { |
There was a problem hiding this comment.
minor: a little duplicated with https://github.com/opensearch-project/sql/blob/main/core/src/main/java/org/opensearch/sql/executor/QueryType.java
Signed-off-by: Peng Huo <penghuo@gmail.com>
--------- Signed-off-by: Peng Huo <penghuo@gmail.com> Signed-off-by: xinyual <xinyual@amazon.com>
Description
This PR introduces a language specification abstraction to support SQL and PPL query processing. The main changes include:
To Reviewer
Related Issues
#3339
Check List
--signoff.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.