[ 
https://issues.apache.org/jira/browse/CALCITE-6344?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Yu Xu resolved CALCITE-6344.
----------------------------
    Fix Version/s: 1.43.0
       Resolution: Fixed

Fixed in 
[c455453|https://github.com/apache/calcite/commit/c4554539114f180de945bb1a54d2d254b6456328]

Thank you for reporting the Jira! [~antonkw] 

Thank you for the review! [~asolimando] [~jensen] 

> RelToSqlConverter invalid quotation for arrays and item operator(ansi dialect)
> ------------------------------------------------------------------------------
>
>                 Key: CALCITE-6344
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6344
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Anton Kovalevsky
>            Assignee: Yu Xu
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.43.0
>
>
>  
> The context:
>  * Ansi Dialect
>  * having array of objects
>  * get an object by id and get property
> "books"[0]."title" turns into ```books``[0]`.`title`
> I added test case to  RelToSqlConverterTest to show what I met:
> {code:java}
> @Test
> void testSqlItemOperator2() {
>   new Sql(CalciteAssert.SchemaSpec.BOOKSTORE,
>       "SELECT MAP['title', \"books\"[0].\"title\"] from 
> \"bookstore\".\"authors\"",
>       AnsiSqlDialect.DEFAULT, SqlParser.Config.DEFAULT, ImmutableSet.of(),
>       UnaryOperator.identity(), null, ImmutableList.of())
>       .withSql("SELECT \"books\"[0].\"title\" from \"bookstore\".\"authors\"")
>       .schema(CalciteAssert.SchemaSpec.BOOKSTORE)
>       .ok("SELECT `books`[0].`title` FROM `bookstore`.`authors`");
> } {code}
>  
> {noformat}
> java.lang.AssertionError: 
> Expected: is "SELECT `books`[0].`title` FROM `bookstore`.`authors`"
>      but: was "SELECT ```books``[0]`.`title`\nFROM 
> `bookstore`.`authors`"{noformat}
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to