[jira] [Commented] (CALCITE-5918) Add MAP function (enabled in Spark library)
[ https://issues.apache.org/jira/browse/CALCITE-5918?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17769631#comment-17769631 ] Ran Tao commented on CALCITE-5918: -- thanks, then i will support this. > Add MAP function (enabled in Spark library) > --- > > Key: CALCITE-5918 > URL: https://issues.apache.org/jira/browse/CALCITE-5918 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.35.0 >Reporter: Guillaume Massé >Priority: Minor > > Apache Spark map constructor is different than the standard SQL: > [https://spark.apache.org/docs/3.4.0/api/sql/index.html#map] > > {code:java} > SELECT map(1.0, '2', 3.0, '4'); > // {1.0:"2",3.0:"4"} {code} > > related PR that can help implement this: > https://github.com/apache/calcite/pull/3141 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (CALCITE-5918) Add MAP function (enabled in Spark library)
[ https://issues.apache.org/jira/browse/CALCITE-5918?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17769585#comment-17769585 ] Guillaume Massé commented on CALCITE-5918: -- Hi [~taoran] I won't have time to work on this. Feel free to assign this issue to yourself. > Add MAP function (enabled in Spark library) > --- > > Key: CALCITE-5918 > URL: https://issues.apache.org/jira/browse/CALCITE-5918 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.35.0 >Reporter: Guillaume Massé >Priority: Minor > > Apache Spark map constructor is different than the standard SQL: > [https://spark.apache.org/docs/3.4.0/api/sql/index.html#map] > > {code:java} > SELECT map(1.0, '2', 3.0, '4'); > // {1.0:"2",3.0:"4"} {code} > > related PR that can help implement this: > https://github.com/apache/calcite/pull/3141 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (CALCITE-5918) Add MAP function (enabled in Spark library)
[ https://issues.apache.org/jira/browse/CALCITE-5918?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17769514#comment-17769514 ] Ran Tao commented on CALCITE-5918: -- Remind: The map function of spark is different from calcite in two points. The first point is that spark uses map(...), and the second point is that empty map is allowed in spark, such as 'map()', however it will cause exception in calcite. > Add MAP function (enabled in Spark library) > --- > > Key: CALCITE-5918 > URL: https://issues.apache.org/jira/browse/CALCITE-5918 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.35.0 >Reporter: Guillaume Massé >Priority: Minor > > Apache Spark map constructor is different than the standard SQL: > [https://spark.apache.org/docs/3.4.0/api/sql/index.html#map] > > {code:java} > SELECT map(1.0, '2', 3.0, '4'); > // {1.0:"2",3.0:"4"} {code} > > related PR that can help implement this: > https://github.com/apache/calcite/pull/3141 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (CALCITE-5918) Add MAP function (enabled in Spark library)
[ https://issues.apache.org/jira/browse/CALCITE-5918?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17769510#comment-17769510 ] Ran Tao commented on CALCITE-5918: -- [~MasseGuillaume] hi, Guillaume, Are you still continuing this work? I'm glad to support this ticket. I'm asking this because we have added many spark map functions such as map_keys/map_values. however the test cases of these functions are using the standard calcite map constructor. IMHO. if we have standard array/map, spark array/map, this would be consistent. And user can use all spark map functions. > Add MAP function (enabled in Spark library) > --- > > Key: CALCITE-5918 > URL: https://issues.apache.org/jira/browse/CALCITE-5918 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.35.0 >Reporter: Guillaume Massé >Priority: Minor > > Apache Spark map constructor is different than the standard SQL: > [https://spark.apache.org/docs/3.4.0/api/sql/index.html#map] > > {code:java} > SELECT map(1.0, '2', 3.0, '4'); > // {1.0:"2",3.0:"4"} {code} > > related PR that can help implement this: > https://github.com/apache/calcite/pull/3141 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (CALCITE-5918) Add MAP function (enabled in Spark library)
[ https://issues.apache.org/jira/browse/CALCITE-5918?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17753422#comment-17753422 ] Julian Hyde commented on CALCITE-5918: -- For what it's worth, I don't think that standard SQL has a {{MAP}} type or {{MAP}} constructor. Calcite's existing {{MAP}} support was added in commit [645235525|https://github.com/apache/calcite/commits/64523552520635e51fd731b64a13663f45b158d1] and I don't even remember which SQL dialect we based {{MAP}} on. ({{ARRAY}} and {{MULTISET}} are based on the SQL standard.) An example of a {{MAP}} constructor is: {code} MAP ['washington', 1, 'obama', 44] {code} (This should be added to the table in the [SQL reference|https://calcite.apache.org/docs/reference.html#non-scalar-types].) I guess this would be {code} MAP('washington', 1, 'obama', 44) {code} in your proposed syntax. I have no objection to adding a {{MAP}} constructor consistent with Spark, just as we did for {{ARRAY}} in CALCITE-5624. > Add MAP function (enabled in Spark library) > --- > > Key: CALCITE-5918 > URL: https://issues.apache.org/jira/browse/CALCITE-5918 > Project: Calcite > Issue Type: New Feature > Components: core >Affects Versions: 1.35.0 >Reporter: Guillaume Massé >Priority: Minor > > Apache Spark map constructor is different than the standard SQL: > [https://spark.apache.org/docs/3.4.0/api/sql/index.html#map] > > {code:java} > SELECT map(1.0, '2', 3.0, '4'); > // {1.0:"2",3.0:"4"} {code} > > related PR that can help implement this: > https://github.com/apache/calcite/pull/3141 -- This message was sent by Atlassian Jira (v8.20.10#820010)