You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "xuzifu666 (via GitHub)" <gi...@apache.org> on 2025/06/13 07:56:15 UTC

[PR] [CALCITE-7055] Invalid unparse for cast to array type in StarRocks [calcite]

xuzifu666 opened a new pull request, #4415:
URL: https://github.com/apache/calcite/pull/4415

   jira: https://issues.apache.org/jira/browse/CALCITE-7055


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CALCITE-7055] Invalid unparse for cast to array type in StarRocks [calcite]

Posted by "xuzifu666 (via GitHub)" <gi...@apache.org>.
xuzifu666 commented on code in PR #4415:
URL: https://github.com/apache/calcite/pull/4415#discussion_r2146217705


##########
core/src/main/java/org/apache/calcite/sql/dialect/StarRocksSqlDialect.java:
##########
@@ -191,12 +196,25 @@ public StarRocksSqlDialect(Context context) {
         SqlDataTypeSpec keySpec = (SqlDataTypeSpec) getCastSpec(mapSqlType.getKeyType());
         SqlDataTypeSpec valueSpec =
             (SqlDataTypeSpec) getCastSpec(mapSqlType.getValueType());
-        @SuppressWarnings("argument.type.incompatible")
+        SqlDataTypeSpec nonNullKeySpec =
+            requireNonNull(keySpec, "keySpec");
+        SqlDataTypeSpec nonNullValueSpec =
+            requireNonNull(valueSpec, "valueSpec");
         SqlMapTypeNameSpec sqlMapTypeNameSpec =
-            new SqlMapTypeNameSpec(keySpec, valueSpec, SqlParserPos.ZERO);
+            new SqlMapTypeNameSpec(nonNullKeySpec, nonNullValueSpec, SqlParserPos.ZERO);
         return new SqlDataTypeSpec(sqlMapTypeNameSpec,
             SqlParserPos.ZERO);
       case ARRAY:
+        ArraySqlType arraySqlType = (ArraySqlType) type;

Review Comment:
   IMO,this should be the right place. All other dialect casts are here. As mentioned in the issue, this is to solve the compatibility problem of cast array. it won't affect DDL unparsing and DDL is out of scope for dialects currently.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CALCITE-7055] Invalid unparse for cast to array type in StarRocks [calcite]

Posted by "xuzifu666 (via GitHub)" <gi...@apache.org>.
xuzifu666 closed pull request #4415: [CALCITE-7055] Invalid unparse for cast to array type in StarRocks
URL: https://github.com/apache/calcite/pull/4415


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CALCITE-7055] Invalid unparse for cast to array type in StarRocks [calcite]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #4415:
URL: https://github.com/apache/calcite/pull/4415#issuecomment-2969667941

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=4415) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=4415&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=4415&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite&pullRequest=4415&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [100.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=4415&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=4415&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=4415)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CALCITE-7055] Invalid unparse for cast to array type in StarRocks [calcite]

Posted by "xuzifu666 (via GitHub)" <gi...@apache.org>.
xuzifu666 closed pull request #4415: [CALCITE-7055] Invalid unparse for cast to array type in StarRocks
URL: https://github.com/apache/calcite/pull/4415


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CALCITE-7055] Invalid unparse for cast to array type in StarRocks [calcite]

Posted by "xuzifu666 (via GitHub)" <gi...@apache.org>.
xuzifu666 commented on code in PR #4415:
URL: https://github.com/apache/calcite/pull/4415#discussion_r2146212304


##########
core/src/main/java/org/apache/calcite/sql/SqlArrayTypeNameSpec.java:
##########
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.calcite.sql;
+
+import org.apache.calcite.sql.parser.SqlParserPos;
+import org.apache.calcite.sql.type.SqlTypeName;
+
+/**
+ * A SqlArrayTypeNameSpec to parse SQL ARRAY type to {@code ARRAY<VARCHAR>}.

Review Comment:
   Done, had changed as it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CALCITE-7055] Invalid unparse for cast to array type in StarRocks [calcite]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #4415:
URL: https://github.com/apache/calcite/pull/4415#issuecomment-2974796485

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=4415) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=4415&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=4415&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite&pullRequest=4415&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [100.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=4415&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=4415&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=4415)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CALCITE-7055] Invalid unparse for cast to array type in StarRocks [calcite]

Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu merged PR #4415:
URL: https://github.com/apache/calcite/pull/4415


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CALCITE-7055] Invalid unparse for cast to array type in StarRocks [calcite]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #4415:
URL: https://github.com/apache/calcite/pull/4415#issuecomment-2969790581

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=4415) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=4415&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=4415&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite&pullRequest=4415&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [100.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=4415&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=4415&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=4415)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CALCITE-7055] Invalid unparse for cast to array type in StarRocks [calcite]

Posted by "xuzifu666 (via GitHub)" <gi...@apache.org>.
xuzifu666 commented on code in PR #4415:
URL: https://github.com/apache/calcite/pull/4415#discussion_r2146219570


##########
core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java:
##########
@@ -9945,7 +9982,6 @@ private void checkLiteral2(String expression, String expected) {
     String query = "SELECT CAST(array[1,2,3] AS real array) FROM \"employee\"";
     sql(query)
         .withPhoenix().throws_("Phoenix dialect does not support cast to ARRAY")
-        .withStarRocks().throws_("StarRocks dialect does not support cast to ARRAY")

Review Comment:
   Yes, it support such casts since this pr, we can see this fact from the pr test:RelToSqlConverterTest##testCastArrayStarRocks.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CALCITE-7055] Invalid unparse for cast to array type in StarRocks [calcite]

Posted by "xuzifu666 (via GitHub)" <gi...@apache.org>.
xuzifu666 commented on PR #4415:
URL: https://github.com/apache/calcite/pull/4415#issuecomment-2974772461

   > I think you can squash the commits.
   
   OK, had squashed commits, thanks @mihaibudiu 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CALCITE-7055] Invalid unparse for cast to array type in StarRocks [calcite]

Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on code in PR #4415:
URL: https://github.com/apache/calcite/pull/4415#discussion_r2145432734


##########
core/src/main/java/org/apache/calcite/sql/SqlArrayTypeNameSpec.java:
##########
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.calcite.sql;
+
+import org.apache.calcite.sql.parser.SqlParserPos;
+import org.apache.calcite.sql.type.SqlTypeName;
+
+/**
+ * A SqlArrayTypeNameSpec to parse SQL ARRAY type to {@code ARRAY<VARCHAR>}.
+ */
+public class SqlArrayTypeNameSpec extends SqlCollectionTypeNameSpec {
+
+  /**
+   * Creates a {@code SqlArrayTypeNameSpec}.
+   *
+   * @param elementTypeName    Type of the collection element
+   * @param collectionTypeName Collection type name
+   * @param pos                Parser position, must not be null
+   */
+  public SqlArrayTypeNameSpec(SqlTypeNameSpec elementTypeName,

Review Comment:
   This name is confusing, people may think it represents the standard ARRAY type.
   You should name it ...ArrayWithAngleBrackets...



##########
core/src/main/java/org/apache/calcite/sql/SqlArrayTypeNameSpec.java:
##########
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.calcite.sql;
+
+import org.apache.calcite.sql.parser.SqlParserPos;
+import org.apache.calcite.sql.type.SqlTypeName;
+
+/**
+ * A SqlArrayTypeNameSpec to parse SQL ARRAY type to {@code ARRAY<VARCHAR>}.

Review Comment:
   parse or unparse?



##########
core/src/main/java/org/apache/calcite/sql/dialect/StarRocksSqlDialect.java:
##########
@@ -191,12 +196,25 @@ public StarRocksSqlDialect(Context context) {
         SqlDataTypeSpec keySpec = (SqlDataTypeSpec) getCastSpec(mapSqlType.getKeyType());
         SqlDataTypeSpec valueSpec =
             (SqlDataTypeSpec) getCastSpec(mapSqlType.getValueType());
-        @SuppressWarnings("argument.type.incompatible")
+        SqlDataTypeSpec nonNullKeySpec =
+            requireNonNull(keySpec, "keySpec");
+        SqlDataTypeSpec nonNullValueSpec =
+            requireNonNull(valueSpec, "valueSpec");
         SqlMapTypeNameSpec sqlMapTypeNameSpec =
-            new SqlMapTypeNameSpec(keySpec, valueSpec, SqlParserPos.ZERO);
+            new SqlMapTypeNameSpec(nonNullKeySpec, nonNullValueSpec, SqlParserPos.ZERO);
         return new SqlDataTypeSpec(sqlMapTypeNameSpec,
             SqlParserPos.ZERO);
       case ARRAY:
+        ArraySqlType arraySqlType = (ArraySqlType) type;

Review Comment:
   is this the right place to do this transformation?
   For example, this won't affect DDL unparsing (e.g., CREATE TABLE).
   But maybe DDL is out of scope for dialects?



##########
core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java:
##########
@@ -9945,7 +9982,6 @@ private void checkLiteral2(String expression, String expected) {
     String query = "SELECT CAST(array[1,2,3] AS real array) FROM \"employee\"";
     sql(query)
         .withPhoenix().throws_("Phoenix dialect does not support cast to ARRAY")
-        .withStarRocks().throws_("StarRocks dialect does not support cast to ARRAY")

Review Comment:
   so it does support such casts?
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CALCITE-7055] Invalid unparse for cast to array type in StarRocks [calcite]

Posted by "xuzifu666 (via GitHub)" <gi...@apache.org>.
xuzifu666 commented on code in PR #4415:
URL: https://github.com/apache/calcite/pull/4415#discussion_r2146213814


##########
core/src/main/java/org/apache/calcite/sql/SqlArrayTypeNameSpec.java:
##########
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.calcite.sql;
+
+import org.apache.calcite.sql.parser.SqlParserPos;
+import org.apache.calcite.sql.type.SqlTypeName;
+
+/**
+ * A SqlArrayTypeNameSpec to parse SQL ARRAY type to {@code ARRAY<VARCHAR>}.
+ */
+public class SqlArrayTypeNameSpec extends SqlCollectionTypeNameSpec {
+
+  /**
+   * Creates a {@code SqlArrayTypeNameSpec}.
+   *
+   * @param elementTypeName    Type of the collection element
+   * @param collectionTypeName Collection type name
+   * @param pos                Parser position, must not be null
+   */
+  public SqlArrayTypeNameSpec(SqlTypeNameSpec elementTypeName,

Review Comment:
   Yes, I also think this name is not fitable, I have changed it to ```SqlArrayWithAngleBracketsNameSpec```, maybe this will show its usefulness better. @mihaibudiu 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CALCITE-7055] Invalid unparse for cast to array type in StarRocks [calcite]

Posted by "xuzifu666 (via GitHub)" <gi...@apache.org>.
xuzifu666 commented on code in PR #4415:
URL: https://github.com/apache/calcite/pull/4415#discussion_r2146217705


##########
core/src/main/java/org/apache/calcite/sql/dialect/StarRocksSqlDialect.java:
##########
@@ -191,12 +196,25 @@ public StarRocksSqlDialect(Context context) {
         SqlDataTypeSpec keySpec = (SqlDataTypeSpec) getCastSpec(mapSqlType.getKeyType());
         SqlDataTypeSpec valueSpec =
             (SqlDataTypeSpec) getCastSpec(mapSqlType.getValueType());
-        @SuppressWarnings("argument.type.incompatible")
+        SqlDataTypeSpec nonNullKeySpec =
+            requireNonNull(keySpec, "keySpec");
+        SqlDataTypeSpec nonNullValueSpec =
+            requireNonNull(valueSpec, "valueSpec");
         SqlMapTypeNameSpec sqlMapTypeNameSpec =
-            new SqlMapTypeNameSpec(keySpec, valueSpec, SqlParserPos.ZERO);
+            new SqlMapTypeNameSpec(nonNullKeySpec, nonNullValueSpec, SqlParserPos.ZERO);
         return new SqlDataTypeSpec(sqlMapTypeNameSpec,
             SqlParserPos.ZERO);
       case ARRAY:
+        ArraySqlType arraySqlType = (ArraySqlType) type;

Review Comment:
   IMO,this should be the right place. All other dialect casts are also here. As mentioned in the issue, this is to solve the compatibility problem of cast array. it won't affect DDL unparsing and DDL maybe out of scope for dialects currently.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CALCITE-7055] Invalid unparse for cast to array type in StarRocks [calcite]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #4415:
URL: https://github.com/apache/calcite/pull/4415#issuecomment-2971881459

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=4415) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=4415&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=4415&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite&pullRequest=4415&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [100.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=4415&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=4415&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=4415)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org