We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is your feature request related to a problem? Support CAST command.
`cast(expr as dateType)` cast the expr to dataType. return the value of dataType. The following conversion rules are used: +------------+--------+--------+---------+-------------+--------+--------+ | Src/Target | STRING | NUMBER | BOOLEAN | TIMESTAMP | DATE | TIME | +------------+--------+--------+---------+-------------+--------+--------+ | STRING | | Note1 | Note1 | TIMESTAMP() | DATE() | TIME() | +------------+--------+--------+---------+-------------+--------+--------+ | NUMBER | Note1 | | v!=0 | N/A | N/A | N/A | +------------+--------+--------+---------+-------------+--------+--------+ | BOOLEAN | Note1 | v?1:0 | | N/A | N/A | N/A | +------------+--------+--------+---------+-------------+--------+--------+ | TIMESTAMP | Note1 | N/A | N/A | | DATE() | TIME() | +------------+--------+--------+---------+-------------+--------+--------+ | DATE | Note1 | N/A | N/A | N/A | | N/A | +------------+--------+--------+---------+-------------+--------+--------+ | TIME | Note1 | N/A | N/A | N/A | N/A | | +------------+--------+--------+---------+-------------+--------+--------+ Cast to **string** example: os> source=people | eval `cbool` = CAST(true as string), `cint` = CAST(1 as string), `cdate` = CAST(CAST('2012-08-07' as date) as string) | fields `cbool`, `cint`, `cdate` fetched rows / total rows = 1/1 +---------+--------+------------+ | cbool | cint | cdate | |---------+--------+------------| | true | 1 | 2012-08-07 | +---------+--------+------------+
See details in this doc: https://github.com/opensearch-project/opensearch-spark/blob/v0.6.0/docs/ppl-lang/functions/ppl-conversion.md#ppl-type-conversion-functions
What solution would you like? We already have ANTLR definition here:
opensearch-spark/ppl-spark-integration/src/main/antlr4/OpenSearchPPLParser.g4
Line 544 in 90171f3
Need to implement its parser and convert it to Spark function Cast
Cast
The text was updated successfully, but these errors were encountered:
qianheng-aws
Successfully merging a pull request may close this issue.
Is your feature request related to a problem?
Support CAST command.
See details in this doc: https://github.com/opensearch-project/opensearch-spark/blob/v0.6.0/docs/ppl-lang/functions/ppl-conversion.md#ppl-type-conversion-functions
What solution would you like?
We already have ANTLR definition here:
opensearch-spark/ppl-spark-integration/src/main/antlr4/OpenSearchPPLParser.g4
Line 544 in 90171f3
Need to implement its parser and convert it to Spark function
Cast
The text was updated successfully, but these errors were encountered: