[jira] [Updated] (CALCITE-6077) Add FACTORIAL function (enabled in Hive and Spark libraries)
[ https://issues.apache.org/jira/browse/CALCITE-6077?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He updated CALCITE-6077: Description: Add FACTORIAL function (enabled in Hive and Spark libraries) FACTORIAL(expr): Returns the factorial of expr. expr is [0..20]. Otherwise, returns NULL. For example: {code:sql} SELECT factorial(5); >120 {code} See more at [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#factorial] doc. was: Add FACTORIAL functions (enabled in Hive and Spark library) FACTORIAL(expr): Returns the factorial of expr. expr is [0..20]. Otherwise, returns NULL. For example: {code:sql} SELECT factorial(5); >120 {code} See more at [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#factorial] doc. > Add FACTORIAL function (enabled in Hive and Spark libraries) > > > Key: CALCITE-6077 > URL: https://issues.apache.org/jira/browse/CALCITE-6077 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > > Add FACTORIAL function (enabled in Hive and Spark libraries) > FACTORIAL(expr): Returns the factorial of expr. expr is [0..20]. Otherwise, > returns NULL. > For example: > {code:sql} > SELECT factorial(5); > >120 > {code} > See more at > [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] > and > [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#factorial] doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Updated] (CALCITE-6077) Add FACTORIAL function (enabled in Hive and Spark libraries)
[ https://issues.apache.org/jira/browse/CALCITE-6077?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He updated CALCITE-6077: Summary: Add FACTORIAL function (enabled in Hive and Spark libraries) (was: Add FACTORIAL functions (enabled in Hive and Spark library)) > Add FACTORIAL function (enabled in Hive and Spark libraries) > > > Key: CALCITE-6077 > URL: https://issues.apache.org/jira/browse/CALCITE-6077 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > > Add FACTORIAL functions (enabled in Hive and Spark library) > FACTORIAL(expr): Returns the factorial of expr. expr is [0..20]. Otherwise, > returns NULL. > For example: > {code:sql} > SELECT factorial(5); > >120 > {code} > See more at > [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] > and > [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#factorial] doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Updated] (CALCITE-6066) Add HYPOT function (enabled in Spark library)
[ https://issues.apache.org/jira/browse/CALCITE-6066?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He updated CALCITE-6066: Description: Add HYPOT function (enabled in Spark library) HYPOT: returns sqrt(x^2+ y^2) without intermediate overflow or underflow. For example: {code:sql} SELECT hypot(3, 4); > 5.0 {code} See more at [Spark |https://spark.apache.org/docs/latest/api/sql/index.html#hypot]doc. Note that I have checked there is no function with the same name in MySQL/PostgreSQL/Hive/Oracle. was: Add HYPOT function (enabled in Spark library) HYPOT: returns sqrt(x(2 )+ y(2)) without intermediate overflow or underflow. For example: {code:sql} SELECT hypot(3, 4); > 5.0 {code} See more at [Spark |https://spark.apache.org/docs/latest/api/sql/index.html#hypot]doc. Note that I have checked there is no function with the same name in MySQL/PostgreSQL/Hive/Oracle. > Add HYPOT function (enabled in Spark library) > - > > Key: CALCITE-6066 > URL: https://issues.apache.org/jira/browse/CALCITE-6066 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > > Add HYPOT function (enabled in Spark library) > HYPOT: returns sqrt(x^2+ y^2) without intermediate overflow or underflow. For > example: > {code:sql} > SELECT hypot(3, 4); > > 5.0 > {code} > See more at [Spark > |https://spark.apache.org/docs/latest/api/sql/index.html#hypot]doc. > Note that I have checked there is no function with the same name in > MySQL/PostgreSQL/Hive/Oracle. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Updated] (CALCITE-6066) Add HYPOT function (enabled in Spark library)
[ https://issues.apache.org/jira/browse/CALCITE-6066?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He updated CALCITE-6066: Description: Add HYPOT function (enabled in Spark library) HYPOT: returns sqrt(x(2 )+ y(2)) without intermediate overflow or underflow. For example: {code:sql} SELECT hypot(3, 4); > 5.0 {code} See more at [Spark |https://spark.apache.org/docs/latest/api/sql/index.html#hypot]doc. Note that I have checked there is no function with the same name in MySQL/PostgreSQL/Hive/Oracle. was: Add HYPOT function (enabled in Spark library) HYPOT: calculates the hypotenuse of a right-angle triangle. For example: {code:sql} SELECT hypot(3, 4); > 5.0 {code} See more at [Spark |https://spark.apache.org/docs/latest/api/sql/index.html#hypot]doc. Note that I have checked there is no function with the same name in MySQL/PostgreSQL/Hive/Oracle. > Add HYPOT function (enabled in Spark library) > - > > Key: CALCITE-6066 > URL: https://issues.apache.org/jira/browse/CALCITE-6066 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > > Add HYPOT function (enabled in Spark library) > HYPOT: returns sqrt(x(2 )+ y(2)) without intermediate overflow or underflow. > For example: > {code:sql} > SELECT hypot(3, 4); > > 5.0 > {code} > See more at [Spark > |https://spark.apache.org/docs/latest/api/sql/index.html#hypot]doc. > Note that I have checked there is no function with the same name in > MySQL/PostgreSQL/Hive/Oracle. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (CALCITE-6066) Add HYPOT function (enabled in Spark library)
[ https://issues.apache.org/jira/browse/CALCITE-6066?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17780568#comment-17780568 ] Runkang He commented on CALCITE-6066: - I have removed the support for Oracle from title after I checked there is such function in Oracle [documentation|https://docs.oracle.com/cd/B28928_01/server.103/b28925/sqfunc.htm], and test fails in Oracle Live SQL Platform. > Add HYPOT function (enabled in Spark library) > - > > Key: CALCITE-6066 > URL: https://issues.apache.org/jira/browse/CALCITE-6066 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > > Add HYPOT function (enabled in Spark library) > HYPOT: calculates the hypotenuse of a right-angle triangle. For example: > {code:sql} > SELECT hypot(3, 4); > > 5.0 > {code} > See more at [Spark > |https://spark.apache.org/docs/latest/api/sql/index.html#hypot]doc. > Note that I have checked there is no function with the same name in > MySQL/PostgreSQL/Hive/Oracle. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Updated] (CALCITE-6066) Add HYPOT function (enabled in Spark library)
[ https://issues.apache.org/jira/browse/CALCITE-6066?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He updated CALCITE-6066: Description: Add HYPOT function (enabled in Spark library) HYPOT: calculates the hypotenuse of a right-angle triangle. For example: {code:sql} SELECT hypot(3, 4); > 5.0 {code} See more at [Spark |https://spark.apache.org/docs/latest/api/sql/index.html#hypot]doc. Note that I have checked there is no function with the same name in MySQL/PostgreSQL/Hive/Oracle. was: Add HYPOT function (enabled in Spark and Oracle libraries) HYPOT: calculates the hypotenuse of a right-angle triangle. For example: {code:sql} SELECT hypot(3, 4); > 5.0 {code} See more at [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#hypot] and [Oracle|https://docs.oracle.com/en/middleware/fusion-middleware/osa/19.1/using/applying-functions-create-new-column.html#GUID-A6F5689E-6C6D-4FA4-B152-5A5287555C95] doc. Note that I have checked there is no function with the same name in MySQL/PostgreSQL/Hive. > Add HYPOT function (enabled in Spark library) > - > > Key: CALCITE-6066 > URL: https://issues.apache.org/jira/browse/CALCITE-6066 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > > Add HYPOT function (enabled in Spark library) > HYPOT: calculates the hypotenuse of a right-angle triangle. For example: > {code:sql} > SELECT hypot(3, 4); > > 5.0 > {code} > See more at [Spark > |https://spark.apache.org/docs/latest/api/sql/index.html#hypot]doc. > Note that I have checked there is no function with the same name in > MySQL/PostgreSQL/Hive/Oracle. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Updated] (CALCITE-6066) Add HYPOT function (enabled in Spark library)
[ https://issues.apache.org/jira/browse/CALCITE-6066?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He updated CALCITE-6066: Summary: Add HYPOT function (enabled in Spark library) (was: Add HYPOT function (enabled in Spark and Oracle libraries)) > Add HYPOT function (enabled in Spark library) > - > > Key: CALCITE-6066 > URL: https://issues.apache.org/jira/browse/CALCITE-6066 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > > Add HYPOT function (enabled in Spark and Oracle libraries) > HYPOT: calculates the hypotenuse of a right-angle triangle. For example: > {code:sql} > SELECT hypot(3, 4); > > 5.0 > {code} > See more at > [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#hypot] and > [Oracle|https://docs.oracle.com/en/middleware/fusion-middleware/osa/19.1/using/applying-functions-create-new-column.html#GUID-A6F5689E-6C6D-4FA4-B152-5A5287555C95] > doc. > Note that I have checked there is no function with the same name in > MySQL/PostgreSQL/Hive. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (CALCITE-6077) Add FACTORIAL functions (enabled in Hive and Spark library)
[ https://issues.apache.org/jira/browse/CALCITE-6077?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17780133#comment-17780133 ] Runkang He commented on CALCITE-6077: - [~julianhyde] thanks for the advice. The combinations and permutations have a wider range of use, but currently there are no such functions after I checked the main dialects includes MySQL/PostgreSQL/Oracle/BigQuery/Spark/Hive. > Add FACTORIAL functions (enabled in Hive and Spark library) > --- > > Key: CALCITE-6077 > URL: https://issues.apache.org/jira/browse/CALCITE-6077 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > > Add FACTORIAL functions (enabled in Hive and Spark library) > FACTORIAL(expr): Returns the factorial of expr. expr is [0..20]. Otherwise, > returns NULL. > For example: > {code:sql} > SELECT factorial(5); > >120 > {code} > See more at > [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] > and > [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#factorial] doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Assigned] (CALCITE-6077) Add FACTORIAL functions (enabled in Hive and Spark library)
[ https://issues.apache.org/jira/browse/CALCITE-6077?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He reassigned CALCITE-6077: --- Assignee: Runkang He > Add FACTORIAL functions (enabled in Hive and Spark library) > --- > > Key: CALCITE-6077 > URL: https://issues.apache.org/jira/browse/CALCITE-6077 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > > Add FACTORIAL functions (enabled in Hive and Spark library) > FACTORIAL(expr): Returns the factorial of expr. expr is [0..20]. Otherwise, > returns NULL. > For example: > {code:sql} > SELECT factorial(5); > >120 > {code} > See more at > [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] > and > [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#factorial] doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Created] (CALCITE-6077) Add FACTORIAL functions (enabled in Hive and Spark library)
Runkang He created CALCITE-6077: --- Summary: Add FACTORIAL functions (enabled in Hive and Spark library) Key: CALCITE-6077 URL: https://issues.apache.org/jira/browse/CALCITE-6077 Project: Calcite Issue Type: New Feature Components: core Affects Versions: 1.35.0 Reporter: Runkang He Add FACTORIAL functions (enabled in Hive and Spark library) FACTORIAL(expr): Returns the factorial of expr. expr is [0..20]. Otherwise, returns NULL. For example: {code:sql} SELECT factorial(5); >120 {code} See more at [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#factorial] doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Updated] (CALCITE-6066) Add HYPOT function (enabled in Spark and Oracle libraries)
[ https://issues.apache.org/jira/browse/CALCITE-6066?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He updated CALCITE-6066: Description: Add HYPOT function (enabled in Spark and Oracle libraries) HYPOT: calculates the hypotenuse of a right-angle triangle. For example: {code:sql} SELECT hypot(3, 4); > 5.0 {code} See more at [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#hypot] and [Oracle|https://docs.oracle.com/en/middleware/fusion-middleware/osa/19.1/using/applying-functions-create-new-column.html#GUID-A6F5689E-6C6D-4FA4-B152-5A5287555C95] doc. Note that I have checked there is no function with the same name in MySQL/PostgreSQL/Hive. was: Add HYPOT function (enabled in Spark library) HYPOT: calculates the hypotenuse of a right-angle triangle. For example: {code:sql} SELECT hypot(3, 4); > 5.0 {code} See more at [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#hypot] and [Oracle|https://docs.oracle.com/en/middleware/fusion-middleware/osa/19.1/using/applying-functions-create-new-column.html#GUID-A6F5689E-6C6D-4FA4-B152-5A5287555C95] doc. Note that I have checked there is no function with the same name in MySQL/PostgreSQL/Hive. > Add HYPOT function (enabled in Spark and Oracle libraries) > -- > > Key: CALCITE-6066 > URL: https://issues.apache.org/jira/browse/CALCITE-6066 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > > Add HYPOT function (enabled in Spark and Oracle libraries) > HYPOT: calculates the hypotenuse of a right-angle triangle. For example: > {code:sql} > SELECT hypot(3, 4); > > 5.0 > {code} > See more at > [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#hypot] and > [Oracle|https://docs.oracle.com/en/middleware/fusion-middleware/osa/19.1/using/applying-functions-create-new-column.html#GUID-A6F5689E-6C6D-4FA4-B152-5A5287555C95] > doc. > Note that I have checked there is no function with the same name in > MySQL/PostgreSQL/Hive. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Updated] (CALCITE-6066) Add HYPOT function (enabled in Spark and Oracle libraries)
[ https://issues.apache.org/jira/browse/CALCITE-6066?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He updated CALCITE-6066: Summary: Add HYPOT function (enabled in Spark and Oracle libraries) (was: Add HYPOT function (enabled in Spark library)) > Add HYPOT function (enabled in Spark and Oracle libraries) > -- > > Key: CALCITE-6066 > URL: https://issues.apache.org/jira/browse/CALCITE-6066 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > > Add HYPOT function (enabled in Spark library) > HYPOT: calculates the hypotenuse of a right-angle triangle. For example: > {code:sql} > SELECT hypot(3, 4); > > 5.0 > {code} > See more at > [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#hypot] and > [Oracle|https://docs.oracle.com/en/middleware/fusion-middleware/osa/19.1/using/applying-functions-create-new-column.html#GUID-A6F5689E-6C6D-4FA4-B152-5A5287555C95] > doc. > Note that I have checked there is no function with the same name in > MySQL/PostgreSQL/Hive. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Updated] (CALCITE-6066) Add HYPOT function (enabled in Spark library)
[ https://issues.apache.org/jira/browse/CALCITE-6066?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He updated CALCITE-6066: Description: Add HYPOT function (enabled in Spark library) HYPOT: calculates the hypotenuse of a right-angle triangle. For example: {code:sql} SELECT hypot(3, 4); > 5.0 {code} See more at [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#hypot] and [Oracle|https://docs.oracle.com/en/middleware/fusion-middleware/osa/19.1/using/applying-functions-create-new-column.html#GUID-A6F5689E-6C6D-4FA4-B152-5A5287555C95] doc. Note that I have checked there is no function with the same name in MySQL/PostgreSQL/Hive. was: Add HYPOT function (enabled in Spark library) HYPOT: calculates the hypotenuse of a right-angle triangle. For example: {code:sql} SELECT hypot(3, 4); > 5.0 {code} See more at [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#hypot] doc. > Add HYPOT function (enabled in Spark library) > - > > Key: CALCITE-6066 > URL: https://issues.apache.org/jira/browse/CALCITE-6066 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > > Add HYPOT function (enabled in Spark library) > HYPOT: calculates the hypotenuse of a right-angle triangle. For example: > {code:sql} > SELECT hypot(3, 4); > > 5.0 > {code} > See more at > [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#hypot] and > [Oracle|https://docs.oracle.com/en/middleware/fusion-middleware/osa/19.1/using/applying-functions-create-new-column.html#GUID-A6F5689E-6C6D-4FA4-B152-5A5287555C95] > doc. > Note that I have checked there is no function with the same name in > MySQL/PostgreSQL/Hive. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (CALCITE-6065) Add HEX and UNHEX functions (enabled in Hive and Spark libraries)
[ https://issues.apache.org/jira/browse/CALCITE-6065?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17778259#comment-17778259 ] Runkang He commented on CALCITE-6065: - The PR is ready: https://github.com/apache/calcite/pull/3479, I would be very grateful if someone could help review. > Add HEX and UNHEX functions (enabled in Hive and Spark libraries) > - > > Key: CALCITE-6065 > URL: https://issues.apache.org/jira/browse/CALCITE-6065 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > Labels: pull-request-available > > Add HEX and UNHEX functions (enabled in Hive and Spark library) > * HEX: Converts a BIGINT/CHARACTER/BINARY into a hexadecimal CHARACTER. > * UNHEX: Converts a hexadecimal-encoded CHARACTER into BINARY format. > > Note that currently we have supported TO_HEX and FROM_HEX functions in > BigQuery library. These are two similar functions compared to HEX and UNHEX > in Hive and Spark libraries. The similarities and differences are below: > > UNHEX and FROM_HEX have the same logic. > HEX can convert BIGINT/CHARACTER/BINARY value, while TO_HEX can only convert > BINARY value. HEX returns upper case of hexadecimal CHARACTER, while TO_HEX > returns lower case ones. > > See more about HEX in > [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] > and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#hex] doc, > and UNHEX in > [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] > and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#unhex] > doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Updated] (CALCITE-6065) Add HEX and UNHEX functions (enabled in Hive and Spark libraries)
[ https://issues.apache.org/jira/browse/CALCITE-6065?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He updated CALCITE-6065: Summary: Add HEX and UNHEX functions (enabled in Hive and Spark libraries) (was: Add HEX and UNHEX functions (enabled in Hive and Spark library)) > Add HEX and UNHEX functions (enabled in Hive and Spark libraries) > - > > Key: CALCITE-6065 > URL: https://issues.apache.org/jira/browse/CALCITE-6065 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > > Add HEX and UNHEX functions (enabled in Hive and Spark library) > * HEX: Converts a BIGINT/CHARACTER/BINARY into a hexadecimal CHARACTER. > * UNHEX: Converts a hexadecimal-encoded CHARACTER into BINARY format. > > Note that currently we have supported TO_HEX and FROM_HEX functions in > BigQuery library. These are two similar functions compared to HEX and UNHEX > in Hive and Spark libraries. The similarities and differences are below: > > UNHEX and FROM_HEX have the same logic. > HEX can convert BIGINT/CHARACTER/BINARY value, while TO_HEX can only convert > BINARY value. HEX returns upper case of hexadecimal CHARACTER, while TO_HEX > returns lower case ones. > > See more about HEX in > [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] > and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#hex] doc, > and UNHEX in > [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] > and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#unhex] > doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (CALCITE-6066) Add HYPOT function (enabled in Spark library)
[ https://issues.apache.org/jira/browse/CALCITE-6066?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17778255#comment-17778255 ] Runkang He commented on CALCITE-6066: - Added example. The link is accessible in Gmail web ui and Jira webpage. Could you tell me which client you are using, and I will check and fix the broken link issue. > Add HYPOT function (enabled in Spark library) > - > > Key: CALCITE-6066 > URL: https://issues.apache.org/jira/browse/CALCITE-6066 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > > Add HYPOT function (enabled in Spark library) > HYPOT: calculates the hypotenuse of a right-angle triangle. For example: > {code:sql} > SELECT hypot(3, 4); > > 5.0 > {code} > See more at > [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#hypot] doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Updated] (CALCITE-6066) Add HYPOT function (enabled in Spark library)
[ https://issues.apache.org/jira/browse/CALCITE-6066?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He updated CALCITE-6066: Description: Add HYPOT function (enabled in Spark library) HYPOT: calculates the hypotenuse of a right-angle triangle. For example: {code:sql} SELECT hypot(3, 4); > 5.0 {code} See more at [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#hypot] doc. was: Add HYPOT function (enabled in Spark library) HYPOT: calculates the hypotenuse of a right-angle triangle. See more at [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#hypot] doc. > Add HYPOT function (enabled in Spark library) > - > > Key: CALCITE-6066 > URL: https://issues.apache.org/jira/browse/CALCITE-6066 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > > Add HYPOT function (enabled in Spark library) > HYPOT: calculates the hypotenuse of a right-angle triangle. For example: > {code:sql} > SELECT hypot(3, 4); > > 5.0 > {code} > See more at > [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#hypot] doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Updated] (CALCITE-6065) Add HEX and UNHEX functions (enabled in Hive and Spark library)
[ https://issues.apache.org/jira/browse/CALCITE-6065?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He updated CALCITE-6065: Description: Add HEX and UNHEX functions (enabled in Hive and Spark library) * HEX: Converts a BIGINT/CHARACTER/BINARY into a hexadecimal CHARACTER. * UNHEX: Converts a hexadecimal-encoded CHARACTER into BINARY format. Note that currently we have supported TO_HEX and FROM_HEX functions in BigQuery library. These are two similar functions compared to HEX and UNHEX in Hive and Spark libraries. The similarities and differences are below: UNHEX and FROM_HEX have the same logic. HEX can convert BIGINT/CHARACTER/BINARY value, while TO_HEX can only convert BINARY value. HEX returns upper case of hexadecimal CHARACTER, while TO_HEX returns lower case ones. See more about HEX in [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#hex] doc, and UNHEX in [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#unhex] doc. was: Add HEX and UNHEX functions (enabled in Hive and Spark library) * HEX: Converts a BIGINT/CHARACTER/BINARY into a hexadecimal CHARACTER. * UNHEX: Converts a hexadecimal-encoded CHARACTER into BINARY format. Note that currently we have supported TO_HEX and FROM_HEX function in BigQuery library. These are two similar functions compared to HEX and UNHEX in Hive and Spark libraries. The similarities and differences are below: UNHEX and FROM_HEX have the same logic. HEX can convert BIGINT/CHARACTER/BINARY value, while TO_HEX can only convert BINARY value. HEX returns upper case of hexadecimal CHARACTER, while TO_HEX returns lower case ones. See more about HEX in [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#hex] doc, and UNHEX in [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#unhex] doc. > Add HEX and UNHEX functions (enabled in Hive and Spark library) > --- > > Key: CALCITE-6065 > URL: https://issues.apache.org/jira/browse/CALCITE-6065 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > > Add HEX and UNHEX functions (enabled in Hive and Spark library) > * HEX: Converts a BIGINT/CHARACTER/BINARY into a hexadecimal CHARACTER. > * UNHEX: Converts a hexadecimal-encoded CHARACTER into BINARY format. > > Note that currently we have supported TO_HEX and FROM_HEX functions in > BigQuery library. These are two similar functions compared to HEX and UNHEX > in Hive and Spark libraries. The similarities and differences are below: > > UNHEX and FROM_HEX have the same logic. > HEX can convert BIGINT/CHARACTER/BINARY value, while TO_HEX can only convert > BINARY value. HEX returns upper case of hexadecimal CHARACTER, while TO_HEX > returns lower case ones. > > See more about HEX in > [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] > and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#hex] doc, > and UNHEX in > [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] > and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#unhex] > doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Updated] (CALCITE-6065) Add HEX and UNHEX functions (enabled in Hive and Spark library)
[ https://issues.apache.org/jira/browse/CALCITE-6065?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He updated CALCITE-6065: Description: Add HEX and UNHEX functions (enabled in Hive and Spark library) * HEX: Converts a BIGINT/CHARACTER/BINARY into a hexadecimal CHARACTER. * UNHEX: Converts a hexadecimal-encoded CHARACTER into BINARY format. Note that currently we have supported TO_HEX and FROM_HEX function in BigQuery library. These are two similar functions compared to HEX and UNHEX in Hive and Spark libraries. The similarities and differences are below: UNHEX and FROM_HEX have the same logic. HEX can convert BIGINT/CHARACTER/BINARY value, while TO_HEX can only convert BINARY value. HEX returns upper case of hexadecimal CHARACTER, while TO_HEX returns lower case ones. See more about HEX in [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#hex] doc, and UNHEX in [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#unhex] doc. was: Add HEX and UNHEX functions (enabled in Hive and Spark library) * HEX: Converts a BIGINT/CHARACTER/BINARY into a hexadecimal CHARACTER. * UNHEX: Converts a hexadecimal-encoded CHARACTER into BINARY format. Note that currently we have supported _TO_HEX and FROM_HEX function in BigQuery library. These are two similar functions compared to HEX and_ _UNHEX_ _in_ _Hive_ _and Spark libraries. The similarities and differences are below:_ _UNHEX_ _and FROM_HEX have the same logic._ HEX can convert BIGINT/CHARACTER/BINARY value, while _TO_HEX can only convert BINARY value._ _HEX_ _returns upper case of hexadecimal CHARACTER, while TO_HEX returns lower case ones._ _See more about HEX in [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#hex] doc, and UNHEX in [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#unhex] doc._ > Add HEX and UNHEX functions (enabled in Hive and Spark library) > --- > > Key: CALCITE-6065 > URL: https://issues.apache.org/jira/browse/CALCITE-6065 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > > Add HEX and UNHEX functions (enabled in Hive and Spark library) > * HEX: Converts a BIGINT/CHARACTER/BINARY into a hexadecimal CHARACTER. > * UNHEX: Converts a hexadecimal-encoded CHARACTER into BINARY format. > > Note that currently we have supported TO_HEX and FROM_HEX function in > BigQuery library. These are two similar functions compared to HEX and UNHEX > in Hive and Spark libraries. The similarities and differences are below: > > UNHEX and FROM_HEX have the same logic. > HEX can convert BIGINT/CHARACTER/BINARY value, while TO_HEX can only convert > BINARY value. HEX returns upper case of hexadecimal CHARACTER, while TO_HEX > returns lower case ones. > > See more about HEX in > [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] > and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#hex] doc, > and UNHEX in > [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] > and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#unhex] > doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Updated] (CALCITE-6065) Add HEX and UNHEX functions (enabled in Hive and Spark library)
[ https://issues.apache.org/jira/browse/CALCITE-6065?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He updated CALCITE-6065: Description: Add HEX and UNHEX functions (enabled in Hive and Spark library) * HEX: Converts a BIGINT/CHARACTER/BINARY into a hexadecimal CHARACTER. * UNHEX: Converts a hexadecimal-encoded CHARACTER into BINARY format. Note that currently we have supported _TO_HEX and FROM_HEX function in BigQuery library. These are two similar functions compared to HEX and_ _UNHEX_ _in_ _Hive_ _and Spark libraries. The similarities and differences are below:_ _UNHEX_ _and FROM_HEX have the same logic._ HEX can convert BIGINT/CHARACTER/BINARY value, while _TO_HEX can only convert BINARY value._ _HEX_ _returns upper case of hexadecimal CHARACTER, while TO_HEX returns lower case ones._ _See more about HEX in [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#hex] doc, and UNHEX in [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#unhex] doc._ was: Add HEX and UNHEX functions (enabled in Hive and Spark library) * HEX: Converts a BIGINT/CHARACTER/BINARY into a hexadecimal CHARACTER. * UNHEX: Converts a hexadecimal-encoded CHARACTER into BINARY format. See more about HEX in [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#hex] doc, and UNHEX in [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#unhex] doc. > Add HEX and UNHEX functions (enabled in Hive and Spark library) > --- > > Key: CALCITE-6065 > URL: https://issues.apache.org/jira/browse/CALCITE-6065 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > > Add HEX and UNHEX functions (enabled in Hive and Spark library) > * HEX: Converts a BIGINT/CHARACTER/BINARY into a hexadecimal CHARACTER. > * UNHEX: Converts a hexadecimal-encoded CHARACTER into BINARY format. > > Note that currently we have supported _TO_HEX and FROM_HEX function in > BigQuery library. These are two similar functions compared to HEX and_ > _UNHEX_ _in_ _Hive_ _and Spark libraries. The similarities and differences > are below:_ > > _UNHEX_ _and FROM_HEX have the same logic._ > HEX can convert BIGINT/CHARACTER/BINARY value, while _TO_HEX can only convert > BINARY value._ _HEX_ _returns upper case of hexadecimal CHARACTER, while > TO_HEX returns lower case ones._ > > _See more about HEX in > [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] > and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#hex] doc, > and UNHEX in > [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] > and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#unhex] > doc._ -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Assigned] (CALCITE-6066) Add HYPOT function (enabled in Spark library)
[ https://issues.apache.org/jira/browse/CALCITE-6066?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He reassigned CALCITE-6066: --- Assignee: Runkang He > Add HYPOT function (enabled in Spark library) > - > > Key: CALCITE-6066 > URL: https://issues.apache.org/jira/browse/CALCITE-6066 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > > Add HYPOT function (enabled in Spark library) > HYPOT: calculates the hypotenuse of a right-angle triangle. > See more at > [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#hypot] doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Created] (CALCITE-6066) Add HYPOT function (enabled in Spark library)
Runkang He created CALCITE-6066: --- Summary: Add HYPOT function (enabled in Spark library) Key: CALCITE-6066 URL: https://issues.apache.org/jira/browse/CALCITE-6066 Project: Calcite Issue Type: New Feature Components: core Affects Versions: 1.35.0 Reporter: Runkang He Add HYPOT function (enabled in Spark library) HYPOT: calculates the hypotenuse of a right-angle triangle. See more at [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#hypot] doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Updated] (CALCITE-6065) Add HEX and UNHEX functions (enabled in Hive and Spark library)
[ https://issues.apache.org/jira/browse/CALCITE-6065?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He updated CALCITE-6065: Description: Add HEX and UNHEX functions (enabled in Hive and Spark library) * HEX: Converts a BIGINT/CHARACTER/BINARY into a hexadecimal CHARACTER. * UNHEX: Converts a hexadecimal-encoded CHARACTER into BINARY format. See more about HEX in [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#hex] doc, and UNHEX in [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#unhex] doc. was: Add HEX and UNHEX function (enabled in Hive and Spark library) * HEX: Converts a BIGINT/CHARACTER/BINARY into a hexadecimal CHARACTER. * UNHEX: Converts a hexadecimal-encoded CHARACTER into BINARY format. See more about HEX in [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#hex] doc, and UNHEX in [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#unhex] doc. > Add HEX and UNHEX functions (enabled in Hive and Spark library) > --- > > Key: CALCITE-6065 > URL: https://issues.apache.org/jira/browse/CALCITE-6065 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > > Add HEX and UNHEX functions (enabled in Hive and Spark library) > * HEX: Converts a BIGINT/CHARACTER/BINARY into a hexadecimal CHARACTER. > * UNHEX: Converts a hexadecimal-encoded CHARACTER into BINARY format. > See more about HEX in > [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] > and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#hex] doc, > and UNHEX in > [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] > and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#unhex] > doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Updated] (CALCITE-6065) Add HEX and UNHEX functions (enabled in Hive and Spark library)
[ https://issues.apache.org/jira/browse/CALCITE-6065?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He updated CALCITE-6065: Summary: Add HEX and UNHEX functions (enabled in Hive and Spark library) (was: Add HEX and UNHEX function (enabled in Hive and Spark library)) > Add HEX and UNHEX functions (enabled in Hive and Spark library) > --- > > Key: CALCITE-6065 > URL: https://issues.apache.org/jira/browse/CALCITE-6065 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > > Add HEX and UNHEX function (enabled in Hive and Spark library) > * HEX: Converts a BIGINT/CHARACTER/BINARY into a hexadecimal CHARACTER. > * UNHEX: Converts a hexadecimal-encoded CHARACTER into BINARY format. > See more about HEX in > [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] > and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#hex] doc, > and UNHEX in > [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] > and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#unhex] > doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Updated] (CALCITE-6065) Add HEX and UNHEX function (enabled in Hive and Spark library)
[ https://issues.apache.org/jira/browse/CALCITE-6065?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He updated CALCITE-6065: Description: Add HEX and UNHEX function (enabled in Hive and Spark library) * HEX: Converts a BIGINT/CHARACTER/BINARY into a hexadecimal CHARACTER. * UNHEX: Converts a hexadecimal-encoded CHARACTER into BINARY format. See more about HEX in [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#hex] doc, and UNHEX in [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#unhex] doc. was: Add HEX and UNHEX function (enabled in Hive and Spark library) - HEX: Converts a BIGINT/CHARACTER/BINARY into a hexadecimal CHARACTER. - UNHEX: Converts a hexadecimal-encoded CHARACTER into BINARY format. See more about HEX in [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#hex] doc, and UNHEX in [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#unhex] doc. > Add HEX and UNHEX function (enabled in Hive and Spark library) > -- > > Key: CALCITE-6065 > URL: https://issues.apache.org/jira/browse/CALCITE-6065 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Priority: Major > > Add HEX and UNHEX function (enabled in Hive and Spark library) > * HEX: Converts a BIGINT/CHARACTER/BINARY into a hexadecimal CHARACTER. > * UNHEX: Converts a hexadecimal-encoded CHARACTER into BINARY format. > See more about HEX in > [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] > and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#hex] doc, > and UNHEX in > [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] > and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#unhex] > doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Assigned] (CALCITE-6065) Add HEX and UNHEX function (enabled in Hive and Spark library)
[ https://issues.apache.org/jira/browse/CALCITE-6065?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He reassigned CALCITE-6065: --- Assignee: Runkang He > Add HEX and UNHEX function (enabled in Hive and Spark library) > -- > > Key: CALCITE-6065 > URL: https://issues.apache.org/jira/browse/CALCITE-6065 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > > Add HEX and UNHEX function (enabled in Hive and Spark library) > * HEX: Converts a BIGINT/CHARACTER/BINARY into a hexadecimal CHARACTER. > * UNHEX: Converts a hexadecimal-encoded CHARACTER into BINARY format. > See more about HEX in > [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] > and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#hex] doc, > and UNHEX in > [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] > and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#unhex] > doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Created] (CALCITE-6065) Add HEX and UNHEX function (enabled in Hive and Spark library)
Runkang He created CALCITE-6065: --- Summary: Add HEX and UNHEX function (enabled in Hive and Spark library) Key: CALCITE-6065 URL: https://issues.apache.org/jira/browse/CALCITE-6065 Project: Calcite Issue Type: New Feature Components: core Affects Versions: 1.35.0 Reporter: Runkang He Add HEX and UNHEX function (enabled in Hive and Spark library) - HEX: Converts a BIGINT/CHARACTER/BINARY into a hexadecimal CHARACTER. - UNHEX: Converts a hexadecimal-encoded CHARACTER into BINARY format. See more about HEX in [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#hex] doc, and UNHEX in [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#unhex] doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Updated] (CALCITE-5825) Add URL_ENCODE and URL_DECODE function (enabled in Spark library)
[ https://issues.apache.org/jira/browse/CALCITE-5825?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He updated CALCITE-5825: Fix Version/s: 1.36.0 Affects Version/s: 1.35.0 > Add URL_ENCODE and URL_DECODE function (enabled in Spark library) > - > > Key: CALCITE-5825 > URL: https://issues.apache.org/jira/browse/CALCITE-5825 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.34.0, 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > Labels: pull-request-available > Fix For: 1.36.0 > > > Add URL_ENCODE and URL_DECODE function (enabled in Spark library): > * URL_ENCODE(str) - Translates a string into > 'application/x-www-form-urlencoded' format using a specific encoding scheme. > See more details in > [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#url_encode] > doc. > * URL_DECODE(str) - Decodes a {{str}} in 'application/x-www-form-urlencoded' > format using a specific encoding scheme. See more details in > [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#url_decode] > doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Updated] (CALCITE-5826) Add FIND_IN_SET function (enabled in Hive and Spark library)
[ https://issues.apache.org/jira/browse/CALCITE-5826?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He updated CALCITE-5826: Fix Version/s: 1.36.0 Affects Version/s: 1.35.0 > Add FIND_IN_SET function (enabled in Hive and Spark library) > > > Key: CALCITE-5826 > URL: https://issues.apache.org/jira/browse/CALCITE-5826 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.34.0, 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > Labels: pull-request-available > Fix For: 1.36.0 > > > Add FIND_IN_SET function (enabled in Hive and Spark library): > > FIND_IN_SET(str, str_array) - find_in_set(str, str_array) - Returns the index > (1-based) of the given string ({{{}str{}}}) in the comma-delimited list > ({{{}str_array{}}}). Returns 0, if the string was not found or if the given > string ({{{}str{}}}) contains a comma. > > See more details in > [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-StringFunctions] > and > [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#find_in_set] > doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Updated] (CALCITE-5923) Some test cases in `SqlOperatorTest` violates the test fixture's design principle
[ https://issues.apache.org/jira/browse/CALCITE-5923?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He updated CALCITE-5923: Fix Version/s: 1.36.0 > Some test cases in `SqlOperatorTest` violates the test fixture's design > principle > - > > Key: CALCITE-5923 > URL: https://issues.apache.org/jira/browse/CALCITE-5923 > Project: Calcite > Issue Type: Bug > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Minor > Labels: pull-request-available > Fix For: 1.36.0 > > > There are some test cases in `SqlOperatorTest` directly use the > `SqlOperatorFixtureImpl.DEFAULT` to get the `SqlOperatorFixture`, including > `SqlOperatorTest.testCast` and many other test cases related with `CAST` > operator. This causes that the result check is missing when execute > `CalciteSqlOperatorTest`, which should has result check. > This violates the design principle introduced by CALCITE-4885, which we > should alway use `SqlOperatorTest.fixture()` to get the `SqlOperatorFixture`. > This principle allows us to override`fixture()` method in subclasses to run > tests in a different environment. > So I think we should fix these related test cases to keep consistent with the > principle. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (CALCITE-5990) Explicit cast to numeric type doesn't check overflow
[ https://issues.apache.org/jira/browse/CALCITE-5990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17775360#comment-17775360 ] Runkang He commented on CALCITE-5990: - [~mbudiu] thanks for the reply, I am still working on it. Currently I have finished the literal's sql2rel and enumeration mode overflow check. For the general enumeration mode overflow check, it is more complex and still work on it. > Explicit cast to numeric type doesn't check overflow > > > Key: CALCITE-5990 > URL: https://issues.apache.org/jira/browse/CALCITE-5990 > Project: Calcite > Issue Type: Bug > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Blocker > Fix For: 1.36.0 > > > Explicit cast to numeric type doesn't check overflow, and this issue can be > reproduced by sqlline: > {code:sql} > select cast(empno as tinyint), cast(130 as tinyint) from emps where > name='Alice'; -- empno is 130 > {code} > The empno is INT type. The result is wrong: > {code:sql} > -126, -126{code} > I think it should throw exception when overflow, instead of returning wrong > result to user. > At last, this issue was found when to turn on runtime check for > CalciteSqlOperatorTest in CALCITE-5921. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Updated] (CALCITE-5990) Explicit cast to numeric type doesn't check overflow
[ https://issues.apache.org/jira/browse/CALCITE-5990?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He updated CALCITE-5990: Description: Explicit cast to numeric type doesn't check overflow, and this issue can be reproduced by sqlline: {code:sql} select cast(empno as tinyint), cast(130 as tinyint) from emps where name='Alice'; -- empno is 130 {code} The empno is INT type. The result is wrong: {code:sql} -126, -126{code} I think it should throw exception when overflow, instead of returning wrong result to user. At last, this issue was found when to turn on runtime check for CalciteSqlOperatorTest in CALCITE-5921. was: Explicit cast to numeric type doesn't check overflow, and this issue can be reproduced by sqlline: {code:sql} select cast(empno as tinyint), cast(130 as tinyint) from emps where name='Alice'; -- empno is 130 {code} The empno is INT type. The result is: {code:sql} -126, -126{code} I think it should throw exception when overflow. At last, this issue was found when to turn on runtime check for CalciteSqlOperatorTest in CALCITE-5921. > Explicit cast to numeric type doesn't check overflow > > > Key: CALCITE-5990 > URL: https://issues.apache.org/jira/browse/CALCITE-5990 > Project: Calcite > Issue Type: Bug > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Blocker > Fix For: 1.36.0 > > > Explicit cast to numeric type doesn't check overflow, and this issue can be > reproduced by sqlline: > {code:sql} > select cast(empno as tinyint), cast(130 as tinyint) from emps where > name='Alice'; -- empno is 130 > {code} > The empno is INT type. The result is wrong: > {code:sql} > -126, -126{code} > I think it should throw exception when overflow, instead of returning wrong > result to user. > At last, this issue was found when to turn on runtime check for > CalciteSqlOperatorTest in CALCITE-5921. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Assigned] (CALCITE-5957) Valid DATE '1945-2-2' is not accepted due to regression
[ https://issues.apache.org/jira/browse/CALCITE-5957?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He reassigned CALCITE-5957: --- Assignee: Runkang He > Valid DATE '1945-2-2' is not accepted due to regression > --- > > Key: CALCITE-5957 > URL: https://issues.apache.org/jira/browse/CALCITE-5957 > Project: Calcite > Issue Type: Bug > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Blocker > Fix For: avatica-1.24.0 > > Attachments: image-2023-08-27-19-09-33-284.png > > Time Spent: 10m > Remaining Estimate: 0h > > DATE '1945-2-2' is a valid date. In CALCITE-5923 when we turn on the result > check of `testCastStringToDateTime`, we find that Calcite accepted DATE > '1945-2-2' before CALCITE-5678 but not afterwards, so this is a regression > that we need to fix. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (CALCITE-5990) Explicit cast to numeric type doesn't check overflow
[ https://issues.apache.org/jira/browse/CALCITE-5990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17770866#comment-17770866 ] Runkang He commented on CALCITE-5990: - Hi [~uilx744], this issue is related to CALCITE-5921, which means the test suite runs but doesn't check runtime failure unexpectedly. For more useful information about existing tests, you can refer to the document [https://calcite.apache.org/docs/howto.html#running-tests]. We can see that not every test will be executed after each commit is pushed, but the main test suites will. > Explicit cast to numeric type doesn't check overflow > > > Key: CALCITE-5990 > URL: https://issues.apache.org/jira/browse/CALCITE-5990 > Project: Calcite > Issue Type: Bug > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Blocker > Fix For: 1.36.0 > > > Explicit cast to numeric type doesn't check overflow, and this issue can be > reproduced by sqlline: > {code:sql} > select cast(empno as tinyint), cast(130 as tinyint) from emps where > name='Alice'; -- empno is 130 > {code} > The empno is INT type. The result is: > {code:sql} > -126, -126{code} > I think it should throw exception when overflow. > At last, this issue was found when to turn on runtime check for > CalciteSqlOperatorTest in CALCITE-5921. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (CALCITE-5990) Explicit cast to numeric type doesn't check overflow
[ https://issues.apache.org/jira/browse/CALCITE-5990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17768190#comment-17768190 ] Runkang He commented on CALCITE-5990: - [~libenchao] Yes, this is a regression. I have updated the jira's info. > Explicit cast to numeric type doesn't check overflow > > > Key: CALCITE-5990 > URL: https://issues.apache.org/jira/browse/CALCITE-5990 > Project: Calcite > Issue Type: Bug > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Blocker > Fix For: 1.36.0 > > > Explicit cast to numeric type doesn't check overflow, and this issue can be > reproduced by sqlline: > {code:sql} > select cast(empno as tinyint), cast(130 as tinyint) from emps where > name='Alice'; -- empno is 130 > {code} > The empno is INT type. The result is: > {code:sql} > -126, -126{code} > I think it should throw exception when overflow. > At last, this issue was found when to turn on runtime check for > CalciteSqlOperatorTest in CALCITE-5921. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Updated] (CALCITE-5990) Explicit cast to numeric type doesn't check overflow
[ https://issues.apache.org/jira/browse/CALCITE-5990?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He updated CALCITE-5990: Fix Version/s: 1.36.0 > Explicit cast to numeric type doesn't check overflow > > > Key: CALCITE-5990 > URL: https://issues.apache.org/jira/browse/CALCITE-5990 > Project: Calcite > Issue Type: Bug > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Blocker > Fix For: 1.36.0 > > > Explicit cast to numeric type doesn't check overflow, and this issue can be > reproduced by sqlline: > {code:sql} > select cast(empno as tinyint), cast(130 as tinyint) from emps where > name='Alice'; -- empno is 130 > {code} > The empno is INT type. The result is: > {code:sql} > -126, -126{code} > I think it should throw exception when overflow. > At last, this issue was found when to turn on runtime check for > CalciteSqlOperatorTest in CALCITE-5921. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Updated] (CALCITE-5990) Explicit cast to numeric type doesn't check overflow
[ https://issues.apache.org/jira/browse/CALCITE-5990?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He updated CALCITE-5990: Priority: Blocker (was: Major) > Explicit cast to numeric type doesn't check overflow > > > Key: CALCITE-5990 > URL: https://issues.apache.org/jira/browse/CALCITE-5990 > Project: Calcite > Issue Type: Bug > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Blocker > > Explicit cast to numeric type doesn't check overflow, and this issue can be > reproduced by sqlline: > {code:sql} > select cast(empno as tinyint), cast(130 as tinyint) from emps where > name='Alice'; -- empno is 130 > {code} > The empno is INT type. The result is: > {code:sql} > -126, -126{code} > I think it should throw exception when overflow. > At last, this issue was found when to turn on runtime check for > CalciteSqlOperatorTest in CALCITE-5921. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (CALCITE-5957) Valid DATE '1945-2-2' is not accepted due to regression
[ https://issues.apache.org/jira/browse/CALCITE-5957?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17768187#comment-17768187 ] Runkang He commented on CALCITE-5957: - [~zstan] This can be splited to another jira. For current issue, we need to fix regression. If you don't mind, I would take this issue to continue. > Valid DATE '1945-2-2' is not accepted due to regression > --- > > Key: CALCITE-5957 > URL: https://issues.apache.org/jira/browse/CALCITE-5957 > Project: Calcite > Issue Type: Bug > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Priority: Blocker > Fix For: avatica-1.24.0 > > Attachments: image-2023-08-27-19-09-33-284.png > > Time Spent: 10m > Remaining Estimate: 0h > > DATE '1945-2-2' is a valid date. In CALCITE-5923 when we turn on the result > check of `testCastStringToDateTime`, we find that Calcite accepted DATE > '1945-2-2' before CALCITE-5678 but not afterwards, so this is a regression > that we need to fix. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Comment Edited] (CALCITE-5957) Valid DATE '1945-2-2' is not accepted due to regression
[ https://issues.apache.org/jira/browse/CALCITE-5957?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17766814#comment-17766814 ] Runkang He edited comment on CALCITE-5957 at 9/19/23 2:24 PM: -- I agree Julian's explanation, and then I think CALCITE-5678 is not intended to fully use strict ISO-8601 standard to replace the old way. So now we still use the old date parsing method. The plan to use strict ISO-8601 standard may need more discussion later. As [~zabetak] pointed out, people have different opinions on the topic, and I also prefer to use strict mode personally. I think '900-01-01' is valid to keep consistent with other parts of date or time with leading zeros. '2023-01-01 22:00:00.123.123' is invalid because the last '.123' is invalid as a time string. We need correct punctuations to define the valid date and time string, and should reject the wrong punctuations. was (Author: JIRAUSER280488): I agree Julian's explanation, and then I think CALCITE-5678 is not intended to fully use strict ISO-8601 standard to replace the old way. So now we still use the old date parsing method. The plan to use strict ISO-8601 standard may need more discussion later. As [~zabetak] pointed out, people have different opinions on the topic, and I also pefer to use strict mode personally. I think '900-01-01' is valid to keep consistent with other parts of date or time with leading zeros. '2023-01-01 22:00:00.123.123' is invalid because the last '.123' is invalid as a time string. We need correct punctuations to define the valid date and time string, and should reject the wrong punctuations. > Valid DATE '1945-2-2' is not accepted due to regression > --- > > Key: CALCITE-5957 > URL: https://issues.apache.org/jira/browse/CALCITE-5957 > Project: Calcite > Issue Type: Bug > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Priority: Blocker > Fix For: avatica-1.24.0 > > Attachments: image-2023-08-27-19-09-33-284.png > > Time Spent: 10m > Remaining Estimate: 0h > > DATE '1945-2-2' is a valid date. In CALCITE-5923 when we turn on the result > check of `testCastStringToDateTime`, we find that Calcite accepted DATE > '1945-2-2' before CALCITE-5678 but not afterwards, so this is a regression > that we need to fix. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Comment Edited] (CALCITE-5957) Valid DATE '1945-2-2' is not accepted due to regression
[ https://issues.apache.org/jira/browse/CALCITE-5957?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17766814#comment-17766814 ] Runkang He edited comment on CALCITE-5957 at 9/19/23 2:24 PM: -- I agree Julian's explanation, and then I think CALCITE-5678 is not intended to fully use strict ISO-8601 standard to replace the old way. So now we still use the old date parsing method. The plan to use strict ISO-8601 standard may need more discussion later. As [~zabetak] pointed out, people have different opinions on the topic, and I also prefer to use strict mode personally. I think '900-01-01' is valid, to keep consistent with other parts of date or time with leading zeros. '2023-01-01 22:00:00.123.123' is invalid because the last '.123' is invalid as a time string. We need correct punctuations to define the valid date and time string, and should reject the wrong punctuations. was (Author: JIRAUSER280488): I agree Julian's explanation, and then I think CALCITE-5678 is not intended to fully use strict ISO-8601 standard to replace the old way. So now we still use the old date parsing method. The plan to use strict ISO-8601 standard may need more discussion later. As [~zabetak] pointed out, people have different opinions on the topic, and I also prefer to use strict mode personally. I think '900-01-01' is valid to keep consistent with other parts of date or time with leading zeros. '2023-01-01 22:00:00.123.123' is invalid because the last '.123' is invalid as a time string. We need correct punctuations to define the valid date and time string, and should reject the wrong punctuations. > Valid DATE '1945-2-2' is not accepted due to regression > --- > > Key: CALCITE-5957 > URL: https://issues.apache.org/jira/browse/CALCITE-5957 > Project: Calcite > Issue Type: Bug > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Priority: Blocker > Fix For: avatica-1.24.0 > > Attachments: image-2023-08-27-19-09-33-284.png > > Time Spent: 10m > Remaining Estimate: 0h > > DATE '1945-2-2' is a valid date. In CALCITE-5923 when we turn on the result > check of `testCastStringToDateTime`, we find that Calcite accepted DATE > '1945-2-2' before CALCITE-5678 but not afterwards, so this is a regression > that we need to fix. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (CALCITE-5957) Valid DATE '1945-2-2' is not accepted due to regression
[ https://issues.apache.org/jira/browse/CALCITE-5957?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17766814#comment-17766814 ] Runkang He commented on CALCITE-5957: - I agree Julian's explanation, and then I think CALCITE-5678 is not intended to fully use strict ISO-8601 standard to replace the old way. So now we still use the old date parsing method. The plan to use strict ISO-8601 standard may need more discussion later. As [~zabetak] pointed out, people have different opinions on the topic, and I also pefer to use strict mode personally. I think '900-01-01' is valid to keep consistent with other parts of date or time with leading zeros. '2023-01-01 22:00:00.123.123' is invalid because the last '.123' is invalid as a time string. We need correct punctuations to define the valid date and time string, and should reject the wrong punctuations. > Valid DATE '1945-2-2' is not accepted due to regression > --- > > Key: CALCITE-5957 > URL: https://issues.apache.org/jira/browse/CALCITE-5957 > Project: Calcite > Issue Type: Bug > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Priority: Blocker > Fix For: avatica-1.24.0 > > Attachments: image-2023-08-27-19-09-33-284.png > > Time Spent: 10m > Remaining Estimate: 0h > > DATE '1945-2-2' is a valid date. In CALCITE-5923 when we turn on the result > check of `testCastStringToDateTime`, we find that Calcite accepted DATE > '1945-2-2' before CALCITE-5678 but not afterwards, so this is a regression > that we need to fix. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (CALCITE-5990) Explicit cast to numeric type doesn't check overflow
[ https://issues.apache.org/jira/browse/CALCITE-5990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17765392#comment-17765392 ] Runkang He commented on CALCITE-5990: - The direct cause is that this issue is introduced by CALCITE-5843, when in Enumerable's codegen layer, we remove the check for integer overflow[1], and use forced type conversion like `(byte)130` instead. This seems to be a regression and need to fix. Another side, I think we also should check and find overflow problems earlier in `makeCast` at sql2rel phase, rather than at runtime. [1] [https://github.com/apache/calcite/blame/3aee0b86aa23476cbdecc75ad5d43b936a6fff7b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Expressions.java#L575C7-L575C7] > Explicit cast to numeric type doesn't check overflow > > > Key: CALCITE-5990 > URL: https://issues.apache.org/jira/browse/CALCITE-5990 > Project: Calcite > Issue Type: Bug > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > > Explicit cast to numeric type doesn't check overflow, and this issue can be > reproduced by sqlline: > {code:sql} > select cast(empno as tinyint), cast(130 as tinyint) from emps where > name='Alice'; -- empno is 130 > {code} > The empno is INT type. The result is: > {code:sql} > -126, -126{code} > I think it should throw exception when overflow. > At last, this issue was found when to turn on runtime check for > CalciteSqlOperatorTest in CALCITE-5921. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Comment Edited] (CALCITE-5990) Explicit cast to numeric type doesn't check overflow
[ https://issues.apache.org/jira/browse/CALCITE-5990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17765392#comment-17765392 ] Runkang He edited comment on CALCITE-5990 at 9/14/23 11:50 PM: --- The direct cause is that this issue is introduced by CALCITE-5843, when in Enumerable's codegen layer, we remove the check for integer overflow[1], and use forced type conversion like `(byte)130` instead. This seems to be a regression and need to fix. Another side, I think we also should check and find overflow problems earlier in `makeCast` at sql2rel phase, rather than at runtime. [1][https://github.com/apache/calcite/blame/3aee0b86aa23476cbdecc75ad5d43b936a6fff7b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Expressions.java#L575C7-L575C7] was (Author: JIRAUSER280488): The direct cause is that this issue is introduced by CALCITE-5843, when in Enumerable's codegen layer, we remove the check for integer overflow[1], and use forced type conversion like `(byte)130` instead. This seems to be a regression and need to fix. Another side, I think we also should check and find overflow problems earlier in `makeCast` at sql2rel phase, rather than at runtime. [1] [https://github.com/apache/calcite/blame/3aee0b86aa23476cbdecc75ad5d43b936a6fff7b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Expressions.java#L575C7-L575C7] > Explicit cast to numeric type doesn't check overflow > > > Key: CALCITE-5990 > URL: https://issues.apache.org/jira/browse/CALCITE-5990 > Project: Calcite > Issue Type: Bug > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > > Explicit cast to numeric type doesn't check overflow, and this issue can be > reproduced by sqlline: > {code:sql} > select cast(empno as tinyint), cast(130 as tinyint) from emps where > name='Alice'; -- empno is 130 > {code} > The empno is INT type. The result is: > {code:sql} > -126, -126{code} > I think it should throw exception when overflow. > At last, this issue was found when to turn on runtime check for > CalciteSqlOperatorTest in CALCITE-5921. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Updated] (CALCITE-5990) Explicit cast to numeric type doesn't check overflow
[ https://issues.apache.org/jira/browse/CALCITE-5990?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He updated CALCITE-5990: Description: Explicit cast to numeric type doesn't check overflow, and this issue can be reproduced by sqlline: {code:sql} select cast(empno as tinyint), cast(130 as tinyint) from emps where name='Alice'; -- empno is 130 {code} The empno is INT type. The result is: {code:sql} -126, -126{code} I think it should throw exception when overflow. At last, this issue was found when to turn on runtime check for CalciteSqlOperatorTest in CALCITE-5921. was: Explicit cast to numeric type doesn't check overflow, and this issue can be reproduced by sqlline: {code:sql} select cast(empno as tinyint), cast(130 as tinyint) from emps where name='Alice'; -- empno is 130 {code} The result is: {code:sql} -126, -126{code} I think it should throw exception when overflow. At last, this issue was found when to turn on runtime check for CalciteSqlOperatorTest in CALCITE-5921. > Explicit cast to numeric type doesn't check overflow > > > Key: CALCITE-5990 > URL: https://issues.apache.org/jira/browse/CALCITE-5990 > Project: Calcite > Issue Type: Bug > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > > Explicit cast to numeric type doesn't check overflow, and this issue can be > reproduced by sqlline: > {code:sql} > select cast(empno as tinyint), cast(130 as tinyint) from emps where > name='Alice'; -- empno is 130 > {code} > The empno is INT type. The result is: > {code:sql} > -126, -126{code} > I think it should throw exception when overflow. > At last, this issue was found when to turn on runtime check for > CalciteSqlOperatorTest in CALCITE-5921. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Assigned] (CALCITE-5990) Explicit cast to numeric type doesn't check overflow
[ https://issues.apache.org/jira/browse/CALCITE-5990?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He reassigned CALCITE-5990: --- Assignee: Runkang He > Explicit cast to numeric type doesn't check overflow > > > Key: CALCITE-5990 > URL: https://issues.apache.org/jira/browse/CALCITE-5990 > Project: Calcite > Issue Type: Bug > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > > Explicit cast to numeric type doesn't check overflow, and this issue can be > reproduced by sqlline: > {code:sql} > select cast(empno as tinyint), cast(130 as tinyint) from emps where > name='Alice'; -- empno is 130 > {code} > The result is: > {code:sql} > -126, -126{code} > I think it should throw exception when overflow. > At last, this issue was found when to turn on runtime check for > CalciteSqlOperatorTest in CALCITE-5921. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Created] (CALCITE-5990) Explicit cast to numeric type doesn't check overflow
Runkang He created CALCITE-5990: --- Summary: Explicit cast to numeric type doesn't check overflow Key: CALCITE-5990 URL: https://issues.apache.org/jira/browse/CALCITE-5990 Project: Calcite Issue Type: Bug Components: core Affects Versions: 1.35.0 Reporter: Runkang He Explicit cast to numeric type doesn't check overflow, and this issue can be reproduced by sqlline: {code:sql} select cast(empno as tinyint), cast(130 as tinyint) from emps where name='Alice'; -- empno is 130 {code} The result is: {code:sql} -126, -126{code} I think it should throw exception when overflow. At last, this issue was found when to turn on runtime check for CalciteSqlOperatorTest in CALCITE-5921. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (CALCITE-5957) Valid DATE '1945-2-2' is not accepted due to regression
[ https://issues.apache.org/jira/browse/CALCITE-5957?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17761419#comment-17761419 ] Runkang He commented on CALCITE-5957: - [~zstan] Could you add `1945-2-2 12:2:5` test case to cover TIME type without leading zero? I think we need also fix this in this Jira. > Valid DATE '1945-2-2' is not accepted due to regression > --- > > Key: CALCITE-5957 > URL: https://issues.apache.org/jira/browse/CALCITE-5957 > Project: Calcite > Issue Type: Bug > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Evgeny Stanilovsky >Priority: Major > Labels: pull-request-available > Attachments: image-2023-08-27-19-09-33-284.png > > Time Spent: 10m > Remaining Estimate: 0h > > DATE '1945-2-2' is a valid date. In CALCITE-5923 when we turn on the result > check of `testCastStringToDateTime`, we find that Calcite accepted DATE > '1945-2-2' before CALCITE-5678 but not afterwards, so this is a regression > that we need to fix. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (CALCITE-5957) Valid DATE '1945-2-2' is not accepted due to regression
[ https://issues.apache.org/jira/browse/CALCITE-5957?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17759985#comment-17759985 ] Runkang He commented on CALCITE-5957: - [~zstan] I will review it these days. > Valid DATE '1945-2-2' is not accepted due to regression > --- > > Key: CALCITE-5957 > URL: https://issues.apache.org/jira/browse/CALCITE-5957 > Project: Calcite > Issue Type: Bug > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Evgeny Stanilovsky >Priority: Major > Labels: pull-request-available > Attachments: image-2023-08-27-19-09-33-284.png > > Time Spent: 10m > Remaining Estimate: 0h > > DATE '1945-2-2' is a valid date. In CALCITE-5923 when we turn on the result > check of `testCastStringToDateTime`, we find that Calcite accepted DATE > '1945-2-2' before CALCITE-5678 but not afterwards, so this is a regression > that we need to fix. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (CALCITE-5957) Valid DATE '1945-2-2' is not accepted due to regression
[ https://issues.apache.org/jira/browse/CALCITE-5957?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17759336#comment-17759336 ] Runkang He commented on CALCITE-5957: - There is another similar test case fails due to regression. The test is below: {code:java} f.checkScalar("cast('1241241' as TIMESTAMP)", "1241-01-01 00:00:00", "TIMESTAMP(0) NOT NULL"); {code} Before CALCITE-5678, the test case is passed, and after the change, it fails. I have no idea whether '1241241' is a valid date or not. Could someone in community give some input? > Valid DATE '1945-2-2' is not accepted due to regression > --- > > Key: CALCITE-5957 > URL: https://issues.apache.org/jira/browse/CALCITE-5957 > Project: Calcite > Issue Type: Bug > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Priority: Major > > DATE '1945-2-2' is a valid date. In CALCITE-5923 when we turn on the result > check of `testCastStringToDateTime`, we find that Calcite accepted DATE > '1945-2-2' before CALCITE-5678 but not afterwards, so this is a regression > that we need to fix. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (CALCITE-5923) Some test cases in `SqlOperatorTest` violates the test fixture's design principle
[ https://issues.apache.org/jira/browse/CALCITE-5923?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17759335#comment-17759335 ] Runkang He commented on CALCITE-5923: - [~julianhyde] I tend to keep the current testing framework using fixture, because it's already an complete implementation that works fine, and it is the lowest cost to keep it. > Some test cases in `SqlOperatorTest` violates the test fixture's design > principle > - > > Key: CALCITE-5923 > URL: https://issues.apache.org/jira/browse/CALCITE-5923 > Project: Calcite > Issue Type: Bug > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Minor > Labels: pull-request-available > > There are some test cases in `SqlOperatorTest` directly use the > `SqlOperatorFixtureImpl.DEFAULT` to get the `SqlOperatorFixture`, including > `SqlOperatorTest.testCast` and many other test cases related with `CAST` > operator. This causes that the result check is missing when execute > `CalciteSqlOperatorTest`, which should has result check. > This violates the design principle introduced by CALCITE-4885, which we > should alway use `SqlOperatorTest.fixture()` to get the `SqlOperatorFixture`. > This principle allows us to override`fixture()` method in subclasses to run > tests in a different environment. > So I think we should fix these related test cases to keep consistent with the > principle. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (CALCITE-5923) Some test cases in `SqlOperatorTest` violates the test fixture's design principle
[ https://issues.apache.org/jira/browse/CALCITE-5923?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17759259#comment-17759259 ] Runkang He commented on CALCITE-5923: - The new Jira is CALCITE-5957. > Some test cases in `SqlOperatorTest` violates the test fixture's design > principle > - > > Key: CALCITE-5923 > URL: https://issues.apache.org/jira/browse/CALCITE-5923 > Project: Calcite > Issue Type: Bug > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Minor > Labels: pull-request-available > > There are some test cases in `SqlOperatorTest` directly use the > `SqlOperatorFixtureImpl.DEFAULT` to get the `SqlOperatorFixture`, including > `SqlOperatorTest.testCast` and many other test cases related with `CAST` > operator. This causes that the result check is missing when execute > `CalciteSqlOperatorTest`, which should has result check. > This violates the design principle introduced by CALCITE-4885, which we > should alway use `SqlOperatorTest.fixture()` to get the `SqlOperatorFixture`. > This principle allows us to override`fixture()` method in subclasses to run > tests in a different environment. > So I think we should fix these related test cases to keep consistent with the > principle. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Updated] (CALCITE-5957) Valid DATE '1945-2-2' is not accepted due to regression
[ https://issues.apache.org/jira/browse/CALCITE-5957?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He updated CALCITE-5957: Summary: Valid DATE '1945-2-2' is not accepted due to regression (was: Validate DATE '1945-2-2' is not accepted due to regression) > Valid DATE '1945-2-2' is not accepted due to regression > --- > > Key: CALCITE-5957 > URL: https://issues.apache.org/jira/browse/CALCITE-5957 > Project: Calcite > Issue Type: Bug > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Priority: Major > > DATE '1945-2-2' is a valid date. In CALCITE-5923 when we turn on the result > check of `testCastStringToDateTime`, we find that Calcite accepted DATE > '1945-2-2' before CALCITE-5678 but not afterwards, so this is a regression > that we need to fix. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Created] (CALCITE-5957) Validate DATE '1945-2-2' is not accepted due to regression
Runkang He created CALCITE-5957: --- Summary: Validate DATE '1945-2-2' is not accepted due to regression Key: CALCITE-5957 URL: https://issues.apache.org/jira/browse/CALCITE-5957 Project: Calcite Issue Type: Bug Components: core Affects Versions: 1.35.0 Reporter: Runkang He DATE '1945-2-2' is a validate date. In CALCITE-5923 when we turn on the result check of `testCastStringToDateTime`, we find that Calcite accepted DATE '1945-2-2' before CALCITE-5678 but not afterwards, so this is a regression that we need to fix. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Updated] (CALCITE-5957) Validate DATE '1945-2-2' is not accepted due to regression
[ https://issues.apache.org/jira/browse/CALCITE-5957?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He updated CALCITE-5957: Description: DATE '1945-2-2' is a valid date. In CALCITE-5923 when we turn on the result check of `testCastStringToDateTime`, we find that Calcite accepted DATE '1945-2-2' before CALCITE-5678 but not afterwards, so this is a regression that we need to fix. (was: DATE '1945-2-2' is a validate date. In CALCITE-5923 when we turn on the result check of `testCastStringToDateTime`, we find that Calcite accepted DATE '1945-2-2' before CALCITE-5678 but not afterwards, so this is a regression that we need to fix.) > Validate DATE '1945-2-2' is not accepted due to regression > -- > > Key: CALCITE-5957 > URL: https://issues.apache.org/jira/browse/CALCITE-5957 > Project: Calcite > Issue Type: Bug > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Priority: Major > > DATE '1945-2-2' is a valid date. In CALCITE-5923 when we turn on the result > check of `testCastStringToDateTime`, we find that Calcite accepted DATE > '1945-2-2' before CALCITE-5678 but not afterwards, so this is a regression > that we need to fix. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (CALCITE-5923) Some test cases in `SqlOperatorTest` violates the test fixture's design principle
[ https://issues.apache.org/jira/browse/CALCITE-5923?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17759257#comment-17759257 ] Runkang He commented on CALCITE-5923: - [~julianhyde] Thanks for clarifying the essence of the issue. I believe that Calcite accepted DATE '1945-2-2' before CALCITE-5678 but not afterwards, because the test is passed using avatica-1.23 after the result check is turned on in [Github CI|https://github.com/apache/calcite/pull/3364/checks?check_run_id=15852159948] of the PR's first commit. So this is a regression. I will open a new Jira for it. > Some test cases in `SqlOperatorTest` violates the test fixture's design > principle > - > > Key: CALCITE-5923 > URL: https://issues.apache.org/jira/browse/CALCITE-5923 > Project: Calcite > Issue Type: Bug > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Minor > Labels: pull-request-available > > There are some test cases in `SqlOperatorTest` directly use the > `SqlOperatorFixtureImpl.DEFAULT` to get the `SqlOperatorFixture`, including > `SqlOperatorTest.testCast` and many other test cases related with `CAST` > operator. This causes that the result check is missing when execute > `CalciteSqlOperatorTest`, which should has result check. > This violates the design principle introduced by CALCITE-4885, which we > should alway use `SqlOperatorTest.fixture()` to get the `SqlOperatorFixture`. > This principle allows us to override`fixture()` method in subclasses to run > tests in a different environment. > So I think we should fix these related test cases to keep consistent with the > principle. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (CALCITE-5923) Some test cases in `SqlOperatorTest` violates the test fixture's design principle
[ https://issues.apache.org/jira/browse/CALCITE-5923?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17755547#comment-17755547 ] Runkang He commented on CALCITE-5923: - After fix this issue, the result check for `CAST` operator is turned on, and then, I find a test case `SqlOperatorTest.testCastStringToDateTime` fails due to the failed test below with latest calcite-avatica branch: {code:java} f.checkScalar("cast('1945-2-2 12:2:5' as TIMESTAMP)", "1945-02-02 12:02:05", "TIMESTAMP(0) NOT NULL"); {code} The stacktrace is: {code:java} Caused by: java.lang.IllegalArgumentException: Invalid DATE value, '1945-2-2 12:2:5' at org.apache.calcite.avatica.util.DateTimeUtils.invalidType(DateTimeUtils.java:809) at org.apache.calcite.avatica.util.DateTimeUtils.validateDate(DateTimeUtils.java:752) at org.apache.calcite.avatica.util.DateTimeUtils.timestampStringToUnixDate0(DateTimeUtils.java:828) at org.apache.calcite.avatica.util.DateTimeUtils.timestampStringToUnixDate(DateTimeUtils.java:815) ... 113 more {code} It seems related to the fix in CALCITE-5678 in avatica-1.24, which use ISO8601 to validate the timestamp string. I think we can safely modify this test case to use `checkFails` with message `Invalid DATE value`. [~zstan] What do you think? Looking forward to your reply. > Some test cases in `SqlOperatorTest` violates the test fixture's design > principle > - > > Key: CALCITE-5923 > URL: https://issues.apache.org/jira/browse/CALCITE-5923 > Project: Calcite > Issue Type: Bug > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Minor > Labels: pull-request-available > > There are some test cases in `SqlOperatorTest` directly use the > `SqlOperatorFixtureImpl.DEFAULT` to get the `SqlOperatorFixture`, including > `SqlOperatorTest.testCast` and many other test cases related with `CAST` > operator. This causes that the result check is missing when execute > `CalciteSqlOperatorTest`, which should has result check. > This violates the design principle introduced by CALCITE-4885, which we > should alway use `SqlOperatorTest.fixture()` to get the `SqlOperatorFixture`. > This principle allows us to override`fixture()` method in subclasses to run > tests in a different environment. > So I think we should fix these related test cases to keep consistent with the > principle. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (CALCITE-5923) Some test cases in `SqlOperatorTest` violates the test fixture's design principle
[ https://issues.apache.org/jira/browse/CALCITE-5923?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17755314#comment-17755314 ] Runkang He commented on CALCITE-5923: - [~julianhyde] Thanks for giving good advice. For the first question, besides parameterized tests using `@MethodSource` annotation, there is other place violates the rule, see [SqlOperatorTest.testArgMin|https://github.com/apache/calcite/blob/51da34bdf91e602f32f965b3490bace026d51ef4/testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java#L11912]. I want to fix them in this Jira at the same time. For the second question, I checked all related test cases using `@MethodSource` annotation in Calcite, excludes `SqlOperatorTest`, they have two manifestations: 1. the test class is a final class or no subclasses, such as `JoinPreserveOrderTest`, `RexBuilderTest`. 2. the method used as MethodSource is self-closing, not refering to other methods of the class, such as `SourceTest.relativePaths` For above reason, I think these places could not benefit from Lifecycle.PER_CLASS currently. But it's more safe to add Lifecycle.PER_CLASS to all these places, to avoid this issue when modifying or adding new test subclasses or methods in the future. > Some test cases in `SqlOperatorTest` violates the test fixture's design > principle > - > > Key: CALCITE-5923 > URL: https://issues.apache.org/jira/browse/CALCITE-5923 > Project: Calcite > Issue Type: Bug > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Minor > Labels: pull-request-available > > There are some test cases in `SqlOperatorTest` directly use the > `SqlOperatorFixtureImpl.DEFAULT` to get the `SqlOperatorFixture`, including > `SqlOperatorTest.testCast` and many other test cases related with `CAST` > operator. This causes that the result check is missing when execute > `CalciteSqlOperatorTest`, which should has result check. > This violates the design principle introduced by CALCITE-4885, which we > should alway use `SqlOperatorTest.fixture()` to get the `SqlOperatorFixture`. > This principle allows us to override`fixture()` method in subclasses to run > tests in a different environment. > So I think we should fix these related test cases to keep consistent with the > principle. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (CALCITE-5921) SqlOperatorFixture.checkFails and checkAggFails don't check runtime failure
[ https://issues.apache.org/jira/browse/CALCITE-5921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17754666#comment-17754666 ] Runkang He commented on CALCITE-5921: - [~julianhyde] Thanks for linking the related issue. I have quickly read the two related issues, and after that, I think this issue may be not directly related to them. It looks like it was introduced by test fixture framework in CALCITE-4885. For more, the basic idea to fix this is to add `tester.checkFails(factory, sap, expectedError, true)` in SqlOperatorFixture.checkFails when runtime is true. > SqlOperatorFixture.checkFails and checkAggFails don't check runtime failure > --- > > Key: CALCITE-5921 > URL: https://issues.apache.org/jira/browse/CALCITE-5921 > Project: Calcite > Issue Type: Bug > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > > SqlOperatorFixture.checkFails and checkAggFails don't check runtime failure. > See more in [code > line|https://github.com/apache/calcite/blob/50c3edfc3d6630528ab51fe836bd50df82cc7db8/testkit/src/main/java/org/apache/calcite/test/SqlOperatorFixtureImpl.java#L160]. > When the parameter `runtime` of SqlOperatorFixture.checkFails is true, it > should execute the query and check runtime failure, but currently it ignores > this, and only checks the parse and validation failure. > When fix this, there are 4 failed test cases in CalciteSqlOperatorTest. > At last, this issue was found when to implement `BIT_GET` function in > CALCITE-5848. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Comment Edited] (CALCITE-5921) SqlOperatorFixture.checkFails and checkAggFails don't check runtime failure
[ https://issues.apache.org/jira/browse/CALCITE-5921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17754666#comment-17754666 ] Runkang He edited comment on CALCITE-5921 at 8/15/23 2:52 PM: -- [~julianhyde] Thanks for linking the related issue. I have quickly read the two related issues, and after that, I think this issue may be not directly related to them. It looks like it was introduced by test fixture framework in CALCITE-4885. For more, the basic idea to fix this is to add `tester.checkFails(factory, sap, expectedError, true)` in SqlOperatorFixture.checkFails when runtime is true. was (Author: JIRAUSER280488): [~julianhyde] Thanks for linking the related issue. I have quickly read the two related issues, and after that, I think this issue may be not directly related to them. It looks like it was introduced by test fixture framework in CALCITE-4885. For more, the basic idea to fix this is to add `tester.checkFails(factory, sap, expectedError, true)` in SqlOperatorFixture.checkFails when runtime is true. > SqlOperatorFixture.checkFails and checkAggFails don't check runtime failure > --- > > Key: CALCITE-5921 > URL: https://issues.apache.org/jira/browse/CALCITE-5921 > Project: Calcite > Issue Type: Bug > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > > SqlOperatorFixture.checkFails and checkAggFails don't check runtime failure. > See more in [code > line|https://github.com/apache/calcite/blob/50c3edfc3d6630528ab51fe836bd50df82cc7db8/testkit/src/main/java/org/apache/calcite/test/SqlOperatorFixtureImpl.java#L160]. > When the parameter `runtime` of SqlOperatorFixture.checkFails is true, it > should execute the query and check runtime failure, but currently it ignores > this, and only checks the parse and validation failure. > When fix this, there are 4 failed test cases in CalciteSqlOperatorTest. > At last, this issue was found when to implement `BIT_GET` function in > CALCITE-5848. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Updated] (CALCITE-5923) Some test cases in `SqlOperatorTest` violates the test fixture's design principle
[ https://issues.apache.org/jira/browse/CALCITE-5923?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He updated CALCITE-5923: Description: There are some test cases in `SqlOperatorTest` directly use the `SqlOperatorFixtureImpl.DEFAULT` to get the `SqlOperatorFixture`, including `SqlOperatorTest.testCast` and many other test cases related with `CAST` operator. This causes that the result check is missing when execute `CalciteSqlOperatorTest`, which should has result check. This violates the design principle introduced by CALCITE-4885, which we should alway use `SqlOperatorTest.fixture()` to get the `SqlOperatorFixture`. This principle allows us to override`fixture()` method in subclasses to run tests in a different environment. So I think we should fix these related test cases to keep consistent with the principle. was: There are some test cases in `SqlOperatorTest` directly use the `SqlOperatorFixtureImpl.DEFAULT` to get the `SqlOperatorFixture`, including `SqlOperatorTest.testCast` and many other test cases related with `CAST` operator. This violates the design principle introduced by CALCITE-4885, which we should alway use `SqlOperatorTest.fixture()` to get the `SqlOperatorFixture`. This principle allows us to override`fixture()` method in subclasses to run tests in a different environment. So I think we should fix these related test cases to keep consistent with the principle. > Some test cases in `SqlOperatorTest` violates the test fixture's design > principle > - > > Key: CALCITE-5923 > URL: https://issues.apache.org/jira/browse/CALCITE-5923 > Project: Calcite > Issue Type: Bug > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Minor > > There are some test cases in `SqlOperatorTest` directly use the > `SqlOperatorFixtureImpl.DEFAULT` to get the `SqlOperatorFixture`, including > `SqlOperatorTest.testCast` and many other test cases related with `CAST` > operator. This causes that the result check is missing when execute > `CalciteSqlOperatorTest`, which should has result check. > This violates the design principle introduced by CALCITE-4885, which we > should alway use `SqlOperatorTest.fixture()` to get the `SqlOperatorFixture`. > This principle allows us to override`fixture()` method in subclasses to run > tests in a different environment. > So I think we should fix these related test cases to keep consistent with the > principle. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Assigned] (CALCITE-5923) Some test cases in `SqlOperatorTest` violates the test fixture's design principle
[ https://issues.apache.org/jira/browse/CALCITE-5923?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He reassigned CALCITE-5923: --- Assignee: Runkang He > Some test cases in `SqlOperatorTest` violates the test fixture's design > principle > - > > Key: CALCITE-5923 > URL: https://issues.apache.org/jira/browse/CALCITE-5923 > Project: Calcite > Issue Type: Bug > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Minor > > There are some test cases in `SqlOperatorTest` directly use the > `SqlOperatorFixtureImpl.DEFAULT` to get the `SqlOperatorFixture`, including > `SqlOperatorTest.testCast` and many other test cases related with `CAST` > operator. > This violates the design principle introduced by CALCITE-4885, which we > should alway use `SqlOperatorTest.fixture()` to get the `SqlOperatorFixture`. > This principle allows us to override`fixture()` method in subclasses to run > tests in a different environment. > So I think we should fix these related test cases to keep consistent with the > principle. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Updated] (CALCITE-5923) Some test cases in `SqlOperatorTest` violates the test fixture's design principle
[ https://issues.apache.org/jira/browse/CALCITE-5923?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He updated CALCITE-5923: Description: There are some test cases in `SqlOperatorTest` directly use the `SqlOperatorFixtureImpl.DEFAULT` to get the `SqlOperatorFixture`, including `SqlOperatorTest.testCast` and many other test cases related with `CAST` operator. This violates the design principle introduced by CALCITE-4885, which we should alway use `SqlOperatorTest.fixture()` to get the `SqlOperatorFixture`. This principle allows us to override`fixture()` method in subclasses to run tests in a different environment. So I think we should fix these related test cases to keep consistent with the principle. was: There are some test cases in `SqlOperatorTest` directly use the `SqlOperatorFixtureImpl.DEFAULT` to get the `SqlOperatorFixture`, including `SqlOperatorTest.testCast` and many other test cases related with `CAST` operator. This violates the design principle introduced by CALCITE-4885, which we should alway use `SqlOperatorTest.fixture()` to get the `SqlOperatorFixture`. This principle allows us to override`fixture()` method in subclasses to run tests in a different environment. So I think we should fix these related test cases to keep consistent with the principle. > Some test cases in `SqlOperatorTest` violates the test fixture's design > principle > - > > Key: CALCITE-5923 > URL: https://issues.apache.org/jira/browse/CALCITE-5923 > Project: Calcite > Issue Type: Bug > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Priority: Minor > > There are some test cases in `SqlOperatorTest` directly use the > `SqlOperatorFixtureImpl.DEFAULT` to get the `SqlOperatorFixture`, including > `SqlOperatorTest.testCast` and many other test cases related with `CAST` > operator. > This violates the design principle introduced by CALCITE-4885, which we > should alway use `SqlOperatorTest.fixture()` to get the `SqlOperatorFixture`. > This principle allows us to override`fixture()` method in subclasses to run > tests in a different environment. > So I think we should fix these related test cases to keep consistent with the > principle. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Created] (CALCITE-5923) Some test cases in `SqlOperatorTest` violates the test fixture's design principle
Runkang He created CALCITE-5923: --- Summary: Some test cases in `SqlOperatorTest` violates the test fixture's design principle Key: CALCITE-5923 URL: https://issues.apache.org/jira/browse/CALCITE-5923 Project: Calcite Issue Type: Bug Components: core Affects Versions: 1.35.0 Reporter: Runkang He There are some test cases in `SqlOperatorTest` directly use the `SqlOperatorFixtureImpl.DEFAULT` to get the `SqlOperatorFixture`, including `SqlOperatorTest.testCast` and many other test cases related with `CAST` operator. This violates the design principle introduced by CALCITE-4885, which we should alway use `SqlOperatorTest.fixture()` to get the `SqlOperatorFixture`. This principle allows us to override`fixture()` method in subclasses to run tests in a different environment. So I think we should fix these related test cases to keep consistent with the principle. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Assigned] (CALCITE-5921) SqlOperatorFixture.checkFails and checkAggFails don't check runtime failure
[ https://issues.apache.org/jira/browse/CALCITE-5921?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He reassigned CALCITE-5921: --- Assignee: Runkang He > SqlOperatorFixture.checkFails and checkAggFails don't check runtime failure > --- > > Key: CALCITE-5921 > URL: https://issues.apache.org/jira/browse/CALCITE-5921 > Project: Calcite > Issue Type: Bug > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > > SqlOperatorFixture.checkFails and checkAggFails don't check runtime failure. > See more in [code > line|https://github.com/apache/calcite/blob/50c3edfc3d6630528ab51fe836bd50df82cc7db8/testkit/src/main/java/org/apache/calcite/test/SqlOperatorFixtureImpl.java#L160]. > When the parameter `runtime` of SqlOperatorFixture.checkFails is true, it > should execute the query and check runtime failure, but currently it ignores > this, and only checks the parse and validation failure. > When fix this, there are 4 failed test cases in CalciteSqlOperatorTest. > At last, this issue was found when to implement `BIT_GET` function in > CALCITE-5848. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Created] (CALCITE-5921) SqlOperatorFixture.checkFails and checkAggFails don't check runtime failure
Runkang He created CALCITE-5921: --- Summary: SqlOperatorFixture.checkFails and checkAggFails don't check runtime failure Key: CALCITE-5921 URL: https://issues.apache.org/jira/browse/CALCITE-5921 Project: Calcite Issue Type: Bug Components: core Affects Versions: 1.35.0 Reporter: Runkang He SqlOperatorFixture.checkFails and checkAggFails don't check runtime failure. See more in [code line|https://github.com/apache/calcite/blob/50c3edfc3d6630528ab51fe836bd50df82cc7db8/testkit/src/main/java/org/apache/calcite/test/SqlOperatorFixtureImpl.java#L160]. When the parameter `runtime` of SqlOperatorFixture.checkFails is true, it should execute the query and check runtime failure, but currently it ignores this, and only checks the parse and validation failure. When fix this, there are 4 failed test cases in CalciteSqlOperatorTest. At last, this issue was found when to implement `BIT_GET` function in CALCITE-5848. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Assigned] (CALCITE-5900) Add TO_BASE64URL and FROM_BASE64URL function (enabled in Presto library)
[ https://issues.apache.org/jira/browse/CALCITE-5900?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He reassigned CALCITE-5900: --- Assignee: Runkang He > Add TO_BASE64URL and FROM_BASE64URL function (enabled in Presto library) > > > Key: CALCITE-5900 > URL: https://issues.apache.org/jira/browse/CALCITE-5900 > Project: Calcite > Issue Type: Sub-task > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > > Add TO_BASE64URL and FROM_BASE64URL function (enabled in Presto library) > Desc: > TO_BASE64URL(binary): Encodes {{binary}} into a base64 string representation > using the URL safe alphabet. > FROM_BASE64URL(string): Decodes binary data from the base64 encoded > {{string}} using the URL safe alphabet. > See more details in > [Presto|https://prestodb.io/docs/current/functions/binary.html] doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Comment Edited] (CALCITE-5895) The result of table sample rate 0 is incorrect result and should return the empty result
[ https://issues.apache.org/jira/browse/CALCITE-5895?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17751350#comment-17751350 ] Runkang He edited comment on CALCITE-5895 at 8/7/23 1:41 PM: - [~shenlang] I agree with the first one. As it is an optimization, it is more suitable and extendable to add this logic in optimization rule, as the reduce expression rule does. was (Author: JIRAUSER280488): [~shenlang] I agree with the first one. It is more extendable to add this logic in optimization rule, as the reduce expression rule does. > The result of table sample rate 0 is incorrect result and should return the > empty result > - > > Key: CALCITE-5895 > URL: https://issues.apache.org/jira/browse/CALCITE-5895 > Project: Calcite > Issue Type: Bug >Reporter: LakeShen >Assignee: LakeShen >Priority: Major > Fix For: 1.36.0 > > Attachments: image-2023-08-05-22-45-02-513.png > > > For The sql: > {code:java} > select * from emp tablesample bernoulli(0) where empno > 5 > {code} > The plan is : > {code:java} > LogicalProject(EMPNO=[$0], ENAME=[$1], JOB=[$2], MGR=[$3], HIREDATE=[$4], > SAL=[$5], COMM=[$6], DEPTNO=[$7], SLACKER=[$8]) > LogicalFilter(condition=[>($0, 5)]) > LogicalTableScan(table=[[CATALOG, SALES, EMP]]) > {code} > I think the correct result of above SQL is empty. > But its result is the following SQL result: > {code:java} > select * from emp where empno > 5 > {code} > It's an incorrect result -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Created] (CALCITE-5900) Add TO_BASE64URL and FROM_BASE64URL function (enabled in Presto library)
Runkang He created CALCITE-5900: --- Summary: Add TO_BASE64URL and FROM_BASE64URL function (enabled in Presto library) Key: CALCITE-5900 URL: https://issues.apache.org/jira/browse/CALCITE-5900 Project: Calcite Issue Type: Sub-task Components: core Affects Versions: 1.35.0 Reporter: Runkang He Add TO_BASE64URL and FROM_BASE64URL function (enabled in Presto library) Desc: TO_BASE64URL(binary): Encodes {{binary}} into a base64 string representation using the URL safe alphabet. FROM_BASE64URL(string): Decodes binary data from the base64 encoded {{string}} using the URL safe alphabet. See more details in [Presto|https://prestodb.io/docs/current/functions/binary.html] doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Updated] (CALCITE-5899) Add HAMMING_DISTANCE function (enabled in Presto library)
[ https://issues.apache.org/jira/browse/CALCITE-5899?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He updated CALCITE-5899: Description: Add HAMMING_DISTANCE function (enabled in Presto library) HAMMING_DISTANCE(string1, string2): Returns the Hamming distance of {{string1}} and {{{}string2{}}}, i.e. the number of positions at which the corresponding characters are different. Note that the two strings must have the same length. See more details in [Presto|https://prestodb.io/docs/current/functions/string.html] doc. was: HAMMING_DISTANCE({_}string1{_}, {_}string2{_}): Returns the Hamming distance of {{string1}} and {{{}string2{}}}, i.e. the number of positions at which the corresponding characters are different. Note that the two strings must have the same length. See more details in [Presto|https://prestodb.io/docs/current/functions/string.html] doc. > Add HAMMING_DISTANCE function (enabled in Presto library) > - > > Key: CALCITE-5899 > URL: https://issues.apache.org/jira/browse/CALCITE-5899 > Project: Calcite > Issue Type: Sub-task > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Priority: Major > > Add HAMMING_DISTANCE function (enabled in Presto library) > HAMMING_DISTANCE(string1, string2): Returns the Hamming distance of > {{string1}} and {{{}string2{}}}, i.e. the number of positions at which the > corresponding characters are different. Note that the two strings must have > the same length. > See more details in > [Presto|https://prestodb.io/docs/current/functions/string.html] doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Updated] (CALCITE-5899) Add HAMMING_DISTANCE function (enabled in Presto library)
[ https://issues.apache.org/jira/browse/CALCITE-5899?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He updated CALCITE-5899: Description: Add HAMMING_DISTANCE function (enabled in Presto library) HAMMING_DISTANCE(string1, string2): Returns the Hamming distance of {{string1}} and {{{}string2{}}}, i.e. the number of positions at which the corresponding characters are different. Note that the two strings must have the same length. See more details in [Presto|https://prestodb.io/docs/current/functions/string.html] doc. was: Add HAMMING_DISTANCE function (enabled in Presto library) HAMMING_DISTANCE(string1, string2): Returns the Hamming distance of {{string1}} and {{{}string2{}}}, i.e. the number of positions at which the corresponding characters are different. Note that the two strings must have the same length. See more details in [Presto|https://prestodb.io/docs/current/functions/string.html] doc. > Add HAMMING_DISTANCE function (enabled in Presto library) > - > > Key: CALCITE-5899 > URL: https://issues.apache.org/jira/browse/CALCITE-5899 > Project: Calcite > Issue Type: Sub-task > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Priority: Major > > Add HAMMING_DISTANCE function (enabled in Presto library) > HAMMING_DISTANCE(string1, string2): Returns the Hamming distance of > {{string1}} and {{{}string2{}}}, i.e. the number of positions at which the > corresponding characters are different. Note that the two strings must have > the same length. > See more details in > [Presto|https://prestodb.io/docs/current/functions/string.html] doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Created] (CALCITE-5899) Add HAMMING_DISTANCE function (enabled in Presto library)
Runkang He created CALCITE-5899: --- Summary: Add HAMMING_DISTANCE function (enabled in Presto library) Key: CALCITE-5899 URL: https://issues.apache.org/jira/browse/CALCITE-5899 Project: Calcite Issue Type: Sub-task Components: core Affects Versions: 1.35.0 Reporter: Runkang He HAMMING_DISTANCE({_}string1{_}, {_}string2{_}): Returns the Hamming distance of {{string1}} and {{{}string2{}}}, i.e. the number of positions at which the corresponding characters are different. Note that the two strings must have the same length. See more details in [Presto|https://prestodb.io/docs/current/functions/string.html] doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Updated] (CALCITE-5898) Add UUID function (enabled in Presto library)
[ https://issues.apache.org/jira/browse/CALCITE-5898?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He updated CALCITE-5898: Parent: CALCITE-5897 Issue Type: Sub-task (was: New Feature) > Add UUID function (enabled in Presto library) > - > > Key: CALCITE-5898 > URL: https://issues.apache.org/jira/browse/CALCITE-5898 > Project: Calcite > Issue Type: Sub-task > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Priority: Major > > Add UUID function (enabled in Presto library) > UUID: Returns a pseudo randomly generated > [UUID|https://prestodb.io/docs/current/language/types.html#uuid-type] (type > 4). > See more details in > [Presto|https://prestodb.io/docs/current/functions/uuid.html] doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Created] (CALCITE-5898) Add UUID function (enabled in Presto library)
Runkang He created CALCITE-5898: --- Summary: Add UUID function (enabled in Presto library) Key: CALCITE-5898 URL: https://issues.apache.org/jira/browse/CALCITE-5898 Project: Calcite Issue Type: New Feature Components: core Affects Versions: 1.35.0 Reporter: Runkang He Add UUID function (enabled in Presto library) UUID: Returns a pseudo randomly generated [UUID|https://prestodb.io/docs/current/language/types.html#uuid-type] (type 4). See more details in [Presto|https://prestodb.io/docs/current/functions/uuid.html] doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Updated] (CALCITE-5897) Add Presto functions
[ https://issues.apache.org/jira/browse/CALCITE-5897?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He updated CALCITE-5897: Description: [Presto|https://prestodb.io/] is a distributed SQL query engine, and it is very popular and widely used, especially in OLAP. Currently we don't support Presto functions, this limits the usage scenarios of Calcite. It would be useful to support them, like previously supported Spark and Hive libraries. > Add Presto functions > > > Key: CALCITE-5897 > URL: https://issues.apache.org/jira/browse/CALCITE-5897 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Priority: Major > > [Presto|https://prestodb.io/] is a distributed SQL query engine, and it is > very popular and widely used, especially in OLAP. Currently we don't support > Presto functions, this limits the usage scenarios of Calcite. > It would be useful to support them, like previously supported Spark and Hive > libraries. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Updated] (CALCITE-5897) Add Presto functions
[ https://issues.apache.org/jira/browse/CALCITE-5897?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He updated CALCITE-5897: Environment: (was: [Presto|https://prestodb.io/] is a distributed SQL query engine, and it is very popular and widely used, especially in OLAP. Currently we don't support Presto functions, this limits the usage scenarios of Calcite. It would be useful to support them, like previously supported Spark and Hive libraries.) > Add Presto functions > > > Key: CALCITE-5897 > URL: https://issues.apache.org/jira/browse/CALCITE-5897 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.35.0 >Reporter: Runkang He >Priority: Major > -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Created] (CALCITE-5897) Add Presto functions
Runkang He created CALCITE-5897: --- Summary: Add Presto functions Key: CALCITE-5897 URL: https://issues.apache.org/jira/browse/CALCITE-5897 Project: Calcite Issue Type: New Feature Components: core Affects Versions: 1.35.0 Environment: [Presto|https://prestodb.io/] is a distributed SQL query engine, and it is very popular and widely used, especially in OLAP. Currently we don't support Presto functions, this limits the usage scenarios of Calcite. It would be useful to support them, like previously supported Spark and Hive libraries. Reporter: Runkang He -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (CALCITE-5895) The result of table sample rate 0 is incorrect result
[ https://issues.apache.org/jira/browse/CALCITE-5895?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17751350#comment-17751350 ] Runkang He commented on CALCITE-5895: - [~shenlang] I agree with the first one. It is more extendable to add this logic in optimization rule, as the reduce expression rule does. > The result of table sample rate 0 is incorrect result > -- > > Key: CALCITE-5895 > URL: https://issues.apache.org/jira/browse/CALCITE-5895 > Project: Calcite > Issue Type: Bug >Reporter: LakeShen >Priority: Major > Fix For: 1.36.0 > > Attachments: image-2023-08-05-22-45-02-513.png > > > For The sql: > {code:java} > select * from emp tablesample bernoulli(0) where empno > 5 > {code} > The plan is : > {code:java} > LogicalProject(EMPNO=[$0], ENAME=[$1], JOB=[$2], MGR=[$3], HIREDATE=[$4], > SAL=[$5], COMM=[$6], DEPTNO=[$7], SLACKER=[$8]) > LogicalFilter(condition=[>($0, 5)]) > LogicalTableScan(table=[[CATALOG, SALES, EMP]]) > {code} > I think the correct result of above SQL is empty. > But its result is the following SQL result: > {code:java} > select * from emp where empno > 5 > {code} > It's an incorrect result -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (CALCITE-5895) The result of table sample rate 0 is incorrect result
[ https://issues.apache.org/jira/browse/CALCITE-5895?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17751317#comment-17751317 ] Runkang He commented on CALCITE-5895: - I wonder whether this is by design or not. Currently in core parser, `TABLESAMPLE(0)` is just ignored, and returns the full result, IMO this is because table sample allows to return more than the specified rate rows. The more detail is in [Parser.jj's comment|https://github.com/apache/calcite/blob/98f3048fb1407e2878162ffc80388d4f9dd094b2/core/src/main/codegen/templates/Parser.jj#L2298]: `TABLESAMPLE(0)` should produce no output, but it simplifies implementation to know that some amount of sampling will occur. But I think it's more reasonable to improve the implementation for `TABLESAMPLE(0)`, to return empty result. > The result of table sample rate 0 is incorrect result > -- > > Key: CALCITE-5895 > URL: https://issues.apache.org/jira/browse/CALCITE-5895 > Project: Calcite > Issue Type: Bug >Reporter: LakeShen >Priority: Major > Fix For: 1.36.0 > > Attachments: image-2023-08-05-22-45-02-513.png > > > For The sql: > {code:java} > select * from emp tablesample bernoulli(0) where empno > 5 > {code} > The plan is : > {code:java} > LogicalProject(EMPNO=[$0], ENAME=[$1], JOB=[$2], MGR=[$3], HIREDATE=[$4], > SAL=[$5], COMM=[$6], DEPTNO=[$7], SLACKER=[$8]) > LogicalFilter(condition=[>($0, 5)]) > LogicalTableScan(table=[[CATALOG, SALES, EMP]]) > {code} > I think the correct result of above SQL is empty. > But its result is the following SQL result: > {code:java} > select * from emp where empno > 5 > {code} > It's an incorrect result -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (CALCITE-5866) Not all dialects support sorting in sub-queries
[ https://issues.apache.org/jira/browse/CALCITE-5866?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17745314#comment-17745314 ] Runkang He commented on CALCITE-5866: - If MSSQL (SQL Server) ignore the `ORDER BY` clause in a sub-query, we have two options: make a new dialect-level setting, or just keep current, to let `ORDER BY` ignored by MSSQL. But if there are some dialects throw exception in that case, we may consider the first option. Another thing is that, IMO the `ORDER BY` clause in a sub-query is useless, because it not affects the final result. Please correct it if I am wrong. > Not all dialects support sorting in sub-queries > --- > > Key: CALCITE-5866 > URL: https://issues.apache.org/jira/browse/CALCITE-5866 > Project: Calcite > Issue Type: Bug >Reporter: Will Noble >Priority: Minor > > The rel-to-sql converter inserts subqueries in certain situations, such as > when sorting by ordinal (see CALCITE-5768). Certain dialects, such as MSSQL > (SQL Server) ignore the {{ORDER BY}} clause in a subquery. We may need a new > dialect-level setting like {{canSortInSubQuery}} that dictates whether > Calcite can safely insert sub-queries with {{ORDER BY}} clauses in them, or > whether it must do everything in it's power to avoid that (such as refusing > to sort by ordinal in cases where not all sort expressions are included in > the {{SELECT}} list). -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Comment Edited] (CALCITE-5863) Calcite rejects valid query with multiple ORDER BY columns and constant RANGE bounds in window functions
[ https://issues.apache.org/jira/browse/CALCITE-5863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17745311#comment-17745311 ] Runkang He edited comment on CALCITE-5863 at 7/20/23 11:30 PM: --- Since Calcite default parser is ANSI standard, could you confirm that the new syntax is allowed in standard? was (Author: JIRAUSER280488): Since calcite default parser is ANSI standard, could you confirm that the new syntax is allowed in standard? > Calcite rejects valid query with multiple ORDER BY columns and constant RANGE > bounds in window functions > > > Key: CALCITE-5863 > URL: https://issues.apache.org/jira/browse/CALCITE-5863 > Project: Calcite > Issue Type: Bug >Affects Versions: 1.34.0 >Reporter: Itiel Sadeh >Priority: Major > Labels: pull-request-available > > Usually, it is not valid to specify multiple ORDER BY columns with RANGE > bounds in window functions: > {code:java} > SELECT sum(x) OVER (ORDER BY x,y RANGE BETWEEN 3 preceding and 4 following) > from t;{code} > However, it is valid if both bounds are "constant" bound (CURRENT ROW, > UNBOUNDED PRECEDING and UNBOUNDED FOLLOWING), i.e: > {code:java} > SELECT sum(x) OVER (ORDER BY x,y RANGE BETWEEN UNBOUNDED PRECEDING and > CURRENT ROW) from t;{code} > (tested on PostgreSQL and SQL Server) > Calcite will incorrectly reject it. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (CALCITE-5863) Calcite rejects valid query with multiple ORDER BY columns and constant RANGE bounds in window functions
[ https://issues.apache.org/jira/browse/CALCITE-5863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17745311#comment-17745311 ] Runkang He commented on CALCITE-5863: - Since calcite default parser is ANSI standard, could you confirm that the new syntax is allowed in standard? > Calcite rejects valid query with multiple ORDER BY columns and constant RANGE > bounds in window functions > > > Key: CALCITE-5863 > URL: https://issues.apache.org/jira/browse/CALCITE-5863 > Project: Calcite > Issue Type: Bug >Affects Versions: 1.34.0 >Reporter: Itiel Sadeh >Priority: Major > Labels: pull-request-available > > Usually, it is not valid to specify multiple ORDER BY columns with RANGE > bounds in window functions: > {code:java} > SELECT sum(x) OVER (ORDER BY x,y RANGE BETWEEN 3 preceding and 4 following) > from t;{code} > However, it is valid if both bounds are "constant" bound (CURRENT ROW, > UNBOUNDED PRECEDING and UNBOUNDED FOLLOWING), i.e: > {code:java} > SELECT sum(x) OVER (ORDER BY x,y RANGE BETWEEN UNBOUNDED PRECEDING and > CURRENT ROW) from t;{code} > (tested on PostgreSQL and SQL Server) > Calcite will incorrectly reject it. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Updated] (CALCITE-5851) Add LEVENSHTEIN function (enabled in Hive and Spark library)
[ https://issues.apache.org/jira/browse/CALCITE-5851?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He updated CALCITE-5851: Description: Add LEVENSHTEIN function (enabled in Hive and Spark library): LEVENSHTEIN(str1, str2) - Returns the Levenshtein distance between the two given strings. See more details in [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-StringFunctions] and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#levenshtein] doc. For more about Levenshtein distance, see [wikipedia|https://en.wikipedia.org/wiki/Levenshtein_distance]. was: Add LEVENSHTEIN function (enabled in Hive and Spark library): LEVENSHTEIN(str1, str2) - Returns the Levenshtein distance between the two given strings. See more details in [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-StringFunctions] and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#levenshtein] doc. > Add LEVENSHTEIN function (enabled in Hive and Spark library) > > > Key: CALCITE-5851 > URL: https://issues.apache.org/jira/browse/CALCITE-5851 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.34.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > > Add LEVENSHTEIN function (enabled in Hive and Spark library): > LEVENSHTEIN(str1, str2) - Returns the Levenshtein distance between the two > given strings. > See more details in > [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-StringFunctions] > and > [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#levenshtein] > doc. > For more about Levenshtein distance, see > [wikipedia|https://en.wikipedia.org/wiki/Levenshtein_distance]. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Assigned] (CALCITE-5850) Enable already available functions for Apache Hive library
[ https://issues.apache.org/jira/browse/CALCITE-5850?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He reassigned CALCITE-5850: --- Assignee: Runkang He > Enable already available functions for Apache Hive library > -- > > Key: CALCITE-5850 > URL: https://issues.apache.org/jira/browse/CALCITE-5850 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.34.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > > There are some useful functions that already exist for other libraries, but > not enabled in Hive library, such as MAP_KEYS/MAP_VALUES/ARRAY_CONTAINS. > > It would be great to enable these functions for Hive library, for larger > scope of use for our users. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Assigned] (CALCITE-5851) Add LEVENSHTEIN function (enabled in Hive and Spark library)
[ https://issues.apache.org/jira/browse/CALCITE-5851?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He reassigned CALCITE-5851: --- Assignee: Runkang He > Add LEVENSHTEIN function (enabled in Hive and Spark library) > > > Key: CALCITE-5851 > URL: https://issues.apache.org/jira/browse/CALCITE-5851 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.34.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > > Add LEVENSHTEIN function (enabled in Hive and Spark library): > LEVENSHTEIN(str1, str2) - Returns the Levenshtein distance between the two > given strings. > See more details in > [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-StringFunctions] > and > [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#levenshtein] > doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Comment Edited] (CALCITE-5851) Add LEVENSHTEIN function (enabled in Hive and Spark library)
[ https://issues.apache.org/jira/browse/CALCITE-5851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17743811#comment-17743811 ] Runkang He edited comment on CALCITE-5851 at 7/17/23 1:44 PM: -- [~jhyde] The example: {code:sql} SELECT levenshtein('kitten', 'sitting'); > 3 {code} The Hive's link is category level only, so we need to search it. The Spark's link can take directly to the function. was (Author: JIRAUSER280488): [~jhyde] The example: {code:sql} SELECT levenshtein('kitten', 'sitting'); > 3 {code} The Hive's link is category level only, so we need to search it. The Spark's link can take directly to the function. > Add LEVENSHTEIN function (enabled in Hive and Spark library) > > > Key: CALCITE-5851 > URL: https://issues.apache.org/jira/browse/CALCITE-5851 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.34.0 >Reporter: Runkang He >Priority: Major > > Add LEVENSHTEIN function (enabled in Hive and Spark library): > LEVENSHTEIN(str1, str2) - Returns the Levenshtein distance between the two > given strings. > See more details in > [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-StringFunctions] > and > [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#levenshtein] > doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (CALCITE-5851) Add LEVENSHTEIN function (enabled in Hive and Spark library)
[ https://issues.apache.org/jira/browse/CALCITE-5851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17743811#comment-17743811 ] Runkang He commented on CALCITE-5851: - [~jhyde] The example: {code:sql} SELECT levenshtein('kitten', 'sitting'); > 3 {code} The Hive's link is category level only, so we need to search it. The Spark's link can take directly to the function. > Add LEVENSHTEIN function (enabled in Hive and Spark library) > > > Key: CALCITE-5851 > URL: https://issues.apache.org/jira/browse/CALCITE-5851 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.34.0 >Reporter: Runkang He >Priority: Major > > Add LEVENSHTEIN function (enabled in Hive and Spark library): > LEVENSHTEIN(str1, str2) - Returns the Levenshtein distance between the two > given strings. > See more details in > [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-StringFunctions] > and > [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#levenshtein] > doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (CALCITE-5838) derive wrong decimal divide type
[ https://issues.apache.org/jira/browse/CALCITE-5838?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17743810#comment-17743810 ] Runkang He commented on CALCITE-5838: - [~pfzhan] IMO this is a meaningful issue, since there is no strict specification for decimal division's result type in ANSI standard: The precision and scale of the result of division are implementation-defined. Maybe we should list the prons and cons of default rule and your rule, if default rule is more reasonable, and covers more scenes, we may define specific rule, if not, could be better to change default rule. > derive wrong decimal divide type > > > Key: CALCITE-5838 > URL: https://issues.apache.org/jira/browse/CALCITE-5838 > Project: Calcite > Issue Type: Bug > Components: core >Affects Versions: 1.34.0 >Reporter: pengfei.zhan >Priority: Major > Fix For: 1.36.0 > > > Given a table metadata structure as follows: > {code:sql} > create table `tbl_test`(`CRR` decimal(38,2), `DT` varchar(4096)) ROW FORMAT > DELIMITED FIELDS TERMINATED BY '\t'; > {code} > If the following query is executed, > {code:sql} > select sum(CRR_0/10.02) from (select sum(CRR) as CRR_0 from tbl_test > where DT='20230705') T1 > {code} > The RexCall CRR_0/10.02 derived a decimal type of decimal(38, 0). I > referred the derived type in spark, but it gives decimal(38, 4). It looks > like the inferred type is more reasonable. > [hive doc | > https://cwiki.apache.org/confluence/download/attachments/27362075/Hive_Decimal_Precision_Scale_Support.pdf] > [sql server doc | https://msdn.microsoft.com/en-us/library/ms190476.aspx] -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Created] (CALCITE-5851) Add LEVENSHTEIN function (enabled in Hive and Spark library)
Runkang He created CALCITE-5851: --- Summary: Add LEVENSHTEIN function (enabled in Hive and Spark library) Key: CALCITE-5851 URL: https://issues.apache.org/jira/browse/CALCITE-5851 Project: Calcite Issue Type: New Feature Components: core Affects Versions: 1.34.0 Reporter: Runkang He Add LEVENSHTEIN function (enabled in Hive and Spark library): LEVENSHTEIN(str1, str2) - Returns the Levenshtein distance between the two given strings. See more details in [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-StringFunctions] and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#levenshtein] doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Created] (CALCITE-5850) Enable already available functions for Apache Hive library
Runkang He created CALCITE-5850: --- Summary: Enable already available functions for Apache Hive library Key: CALCITE-5850 URL: https://issues.apache.org/jira/browse/CALCITE-5850 Project: Calcite Issue Type: New Feature Components: core Affects Versions: 1.34.0 Reporter: Runkang He There are some useful functions that already exist for other libraries, but not enabled in Hive library, such as MAP_KEYS/MAP_VALUES/ARRAY_CONTAINS. It would be great to enable these functions for Hive library, for larger scope of use for our users. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (CALCITE-5809) enable already available functions in Apache Spark Library
[ https://issues.apache.org/jira/browse/CALCITE-5809?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17743343#comment-17743343 ] Runkang He commented on CALCITE-5809: - [~MasseGuillaume] is this Jira in progress? IMO it would be great to enable existed functions in Spark library. Feel free to tag me to help review if you need. > enable already available functions in Apache Spark Library > -- > > Key: CALCITE-5809 > URL: https://issues.apache.org/jira/browse/CALCITE-5809 > Project: Calcite > Issue Type: Improvement >Reporter: Guillaume Massé >Priority: Minor > Labels: pull-request-available > > Those functions are available in Calcite but via different library, we simply > need to add them to the libraries list. > > https://spark.apache.org/docs/3.4.1/api/sql/#to_date > [https://github.com/apache/calcite/blob/50f0e185896a4afb7c77bb6fb4efe41c1531dcfe/core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java#L1262-L1267] > > https://spark.apache.org/docs/3.4.1/api/sql/#to_timestamp > [https://github.com/apache/calcite/blob/50f0e185896a4afb7c77bb6fb4efe41c1531dcfe/core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java#L1271-L1276] > > -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Assigned] (CALCITE-5848) Add BIT_GET and GETBIT function (enabled in Spark library)
[ https://issues.apache.org/jira/browse/CALCITE-5848?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He reassigned CALCITE-5848: --- Assignee: Runkang He > Add BIT_GET and GETBIT function (enabled in Spark library) > -- > > Key: CALCITE-5848 > URL: https://issues.apache.org/jira/browse/CALCITE-5848 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.34.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > > Add BIT_GET and GETBIT function (enabled in Spark library): > BIT_GET(expr, pos) - Returns the value of the bit (0 or 1) at the specified > position. The positions are numbered from right to left, starting at zero. > The position argument cannot be negative. > GETBIT is an alias of BIT_GET. > See more details in > [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#bit_get] doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Assigned] (CALCITE-5849) Add CONV function (enabled in Hive and Spark library)
[ https://issues.apache.org/jira/browse/CALCITE-5849?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He reassigned CALCITE-5849: --- Assignee: Runkang He > Add CONV function (enabled in Hive and Spark library) > - > > Key: CALCITE-5849 > URL: https://issues.apache.org/jira/browse/CALCITE-5849 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.34.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > > Add CONV function (enabled in Hive and Spark library): > CONV(num, from_base, to_base) - Convert num from from_base to to_base. > See more details in > [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] > and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#conv] doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Created] (CALCITE-5849) Add CONV function (enabled in Hive and Spark library)
Runkang He created CALCITE-5849: --- Summary: Add CONV function (enabled in Hive and Spark library) Key: CALCITE-5849 URL: https://issues.apache.org/jira/browse/CALCITE-5849 Project: Calcite Issue Type: New Feature Components: core Affects Versions: 1.34.0 Reporter: Runkang He Add CONV function (enabled in Hive and Spark library): CONV(num, from_base, to_base) - Convert num from from_base to to_base. See more details in [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-MathematicalFunctions] and [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#conv] doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Created] (CALCITE-5848) Add BIT_GET and GETBIT function (enabled in Spark library)
Runkang He created CALCITE-5848: --- Summary: Add BIT_GET and GETBIT function (enabled in Spark library) Key: CALCITE-5848 URL: https://issues.apache.org/jira/browse/CALCITE-5848 Project: Calcite Issue Type: New Feature Components: core Affects Versions: 1.34.0 Reporter: Runkang He Add BIT_GET and GETBIT function (enabled in Spark library): BIT_GET(expr, pos) - Returns the value of the bit (0 or 1) at the specified position. The positions are numbered from right to left, starting at zero. The position argument cannot be negative. GETBIT is an alias of BIT_GET. See more details in [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#bit_get] doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (CALCITE-5820) Add PARSE_URL function (enabled in Hive and Spark library)
[ https://issues.apache.org/jira/browse/CALCITE-5820?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17741795#comment-17741795 ] Runkang He commented on CALCITE-5820: - [~julianhyde] The reason is that {{URL.getPath()}} does not decode %20 to a space, when converting URL to File's pathname arg, File does not recongnize undecoded %20 characters and causes file not found exception. I've found an equivalent method to replace URL.getPath, use URI.getRawPath instead. And the behaviour is same as Hive's implementation, including won't decode %20 to a space. > Add PARSE_URL function (enabled in Hive and Spark library) > -- > > Key: CALCITE-5820 > URL: https://issues.apache.org/jira/browse/CALCITE-5820 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.34.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > Labels: pull-request-available > > Add PARSE_URL (enabled in Hive and Spark library): > PARSE_URL: Returns the specified part from the URL. Valid values for > partToExtract include HOST, PATH, QUERY, REF, PROTOCOL, AUTHORITY, FILE, and > USERINFO. > For example, parse_url('http://facebook.com/path1/p.php?k1=v1=v2#Ref1', > 'HOST') returns 'facebook.com'. > See more details in > [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-StringFunctions] > and > [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#parse_url] doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Comment Edited] (CALCITE-5820) Add PARSE_URL function (enabled in Hive and Spark library)
[ https://issues.apache.org/jira/browse/CALCITE-5820?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17741602#comment-17741602 ] Runkang He edited comment on CALCITE-5820 at 7/10/23 12:57 PM: --- When implementing this function, I found there is a problem to parse the {*}http url{*}. I want to migrate Hive's implementation of this function([link|https://github.com/apache/hive/blob/5e46e80bc7d059093aece81e3886ba5ee425ee95/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFParseUrl.java#L81C8-L81C8]) to keep consistency of results, but in Calcite, we forbid {{URL#getPath}} in signatures.txt(the related issue is CALCITE-2495), then and more, I can not find an equivalent method to keep the same behaviour with Hive. I have tried the suggested {{{}Sources.of(URL).path(){}}}, but the result is different from the Hive's, as below: The http url to process: [http://calcite.apache.org/path1/p.php?k1=v1=v2#Ref1] The result of {{{}Sources.of(URL).path(){}}}: //calcite.apache.org/path1/p.php?k1=v1=v2 The result of {{{}URL#getPath{}}}: /path1/p.php was (Author: JIRAUSER280488): When implementing this function, I found there is a problem to parse the *http url* in current Calcite version. I want to migrate Hive's implementation of this function([link|https://github.com/apache/hive/blob/5e46e80bc7d059093aece81e3886ba5ee425ee95/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFParseUrl.java#L81C8-L81C8]) to keep consistency of results, but in Calcite, we forbid {{URL#getPath}} in signatures.txt(the related issue is CALCITE-2495), then and more, I can not find an equivalent method to keep the same behaviour with Hive. I have tried the suggested {{{}Sources.of(URL).path(){}}}, but the result is different from the Hive's, as below: The http url to process: http://calcite.apache.org/path1/p.php?k1=v1=v2#Ref1 The result of {{{}Sources.of(URL).path(){}}}: //calcite.apache.org/path1/p.php?k1=v1=v2 The result of {{{}URL#getPath{}}}: /path1/p.php > Add PARSE_URL function (enabled in Hive and Spark library) > -- > > Key: CALCITE-5820 > URL: https://issues.apache.org/jira/browse/CALCITE-5820 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.34.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > Labels: pull-request-available > > Add PARSE_URL (enabled in Hive and Spark library): > PARSE_URL: Returns the specified part from the URL. Valid values for > partToExtract include HOST, PATH, QUERY, REF, PROTOCOL, AUTHORITY, FILE, and > USERINFO. > For example, parse_url('http://facebook.com/path1/p.php?k1=v1=v2#Ref1', > 'HOST') returns 'facebook.com'. > See more details in > [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-StringFunctions] > and > [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#parse_url] doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (CALCITE-5820) Add PARSE_URL function (enabled in Hive and Spark library)
[ https://issues.apache.org/jira/browse/CALCITE-5820?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17741602#comment-17741602 ] Runkang He commented on CALCITE-5820: - When implementing this function, I found there is a problem to parse the *http url* in current Calcite version. I want to migrate Hive's implementation of this function([link|https://github.com/apache/hive/blob/5e46e80bc7d059093aece81e3886ba5ee425ee95/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFParseUrl.java#L81C8-L81C8]) to keep consistency of results, but in Calcite, we forbid {{URL#getPath}} in signatures.txt(the related issue is CALCITE-2495), then and more, I can not find an equivalent method to keep the same behaviour with Hive. I have tried the suggested {{{}Sources.of(URL).path(){}}}, but the result is different from the Hive's, as below: The http url to process: http://calcite.apache.org/path1/p.php?k1=v1=v2#Ref1 The result of {{{}Sources.of(URL).path(){}}}: //calcite.apache.org/path1/p.php?k1=v1=v2 The result of {{{}URL#getPath{}}}: /path1/p.php > Add PARSE_URL function (enabled in Hive and Spark library) > -- > > Key: CALCITE-5820 > URL: https://issues.apache.org/jira/browse/CALCITE-5820 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.34.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > Labels: pull-request-available > > Add PARSE_URL (enabled in Hive and Spark library): > PARSE_URL: Returns the specified part from the URL. Valid values for > partToExtract include HOST, PATH, QUERY, REF, PROTOCOL, AUTHORITY, FILE, and > USERINFO. > For example, parse_url('http://facebook.com/path1/p.php?k1=v1=v2#Ref1', > 'HOST') returns 'facebook.com'. > See more details in > [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-StringFunctions] > and > [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#parse_url] doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (CALCITE-5820) Add PARSE_URL function (enabled in Hive and Spark library)
[ https://issues.apache.org/jira/browse/CALCITE-5820?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17741600#comment-17741600 ] Runkang He commented on CALCITE-5820: - [~julianhyde] Thanks for remind. > Add PARSE_URL function (enabled in Hive and Spark library) > -- > > Key: CALCITE-5820 > URL: https://issues.apache.org/jira/browse/CALCITE-5820 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.34.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > Labels: pull-request-available > > Add PARSE_URL (enabled in Hive and Spark library): > PARSE_URL: Returns the specified part from the URL. Valid values for > partToExtract include HOST, PATH, QUERY, REF, PROTOCOL, AUTHORITY, FILE, and > USERINFO. > For example, parse_url('http://facebook.com/path1/p.php?k1=v1=v2#Ref1', > 'HOST') returns 'facebook.com'. > See more details in > [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-StringFunctions] > and > [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#parse_url] doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Assigned] (CALCITE-5825) Add URL_ENCODE and URL_DECODE function (enabled in Spark library)
[ https://issues.apache.org/jira/browse/CALCITE-5825?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He reassigned CALCITE-5825: --- Assignee: Runkang He > Add URL_ENCODE and URL_DECODE function (enabled in Spark library) > - > > Key: CALCITE-5825 > URL: https://issues.apache.org/jira/browse/CALCITE-5825 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.34.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > > Add URL_ENCODE and URL_DECODE function (enabled in Spark library): > * URL_ENCODE(str) - Translates a string into > 'application/x-www-form-urlencoded' format using a specific encoding scheme. > See more details in > [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#url_encode] > doc. > * URL_DECODE(str) - Decodes a {{str}} in 'application/x-www-form-urlencoded' > format using a specific encoding scheme. See more details in > [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#url_decode] > doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Assigned] (CALCITE-5826) Add FIND_IN_SET function (enabled in Hive and Spark library)
[ https://issues.apache.org/jira/browse/CALCITE-5826?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Runkang He reassigned CALCITE-5826: --- Assignee: Runkang He > Add FIND_IN_SET function (enabled in Hive and Spark library) > > > Key: CALCITE-5826 > URL: https://issues.apache.org/jira/browse/CALCITE-5826 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.34.0 >Reporter: Runkang He >Assignee: Runkang He >Priority: Major > > Add FIND_IN_SET function (enabled in Hive and Spark library): > > FIND_IN_SET(str, str_array) - find_in_set(str, str_array) - Returns the index > (1-based) of the given string ({{{}str{}}}) in the comma-delimited list > ({{{}str_array{}}}). Returns 0, if the string was not found or if the given > string ({{{}str{}}}) contains a comma. > > See more details in > [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf#LanguageManualUDF-StringFunctions] > and > [Spark|https://spark.apache.org/docs/latest/api/sql/index.html#find_in_set] > doc. -- This message was sent by Atlassian Jira (v8.20.10#820010)