julianhyde commented on code in PR #4356:
URL: https://github.com/apache/calcite/pull/4356#discussion_r2074016208


##########
core/src/main/java/org/apache/calcite/sql/SqlDialect.java:
##########
@@ -1454,6 +1454,7 @@ public enum DatabaseProduct {
     VERTICA("Vertica", "\"", NullCollation.HIGH),
     SQLSTREAM("SQLstream", "\"", NullCollation.HIGH),
     SPARK("Spark", null, NullCollation.LOW),
+    SQLITE("Sqlite", null, NullCollation.LOW),

Review Comment:
   "Sqlite" should be "SQLite"



##########
core/src/main/java/org/apache/calcite/sql/dialect/SqliteSqlDialect.java:
##########
@@ -0,0 +1,105 @@
+/*
+ * 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.dialect;
+
+import org.apache.calcite.config.NullCollation;
+import org.apache.calcite.rel.type.RelDataTypeSystem;
+import org.apache.calcite.rel.type.RelDataTypeSystemImpl;
+import org.apache.calcite.sql.SqlCall;
+import org.apache.calcite.sql.SqlDialect;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.sql.SqlWriter;
+import org.apache.calcite.sql.fun.SqlLibraryOperators;
+import org.apache.calcite.sql.parser.SqlParserPos;
+import org.apache.calcite.sql.type.SqlTypeName;
+import org.apache.calcite.util.RelToSqlConverterUtil;
+
+import org.checkerframework.checker.nullness.qual.Nullable;
+
+/**
+ * A <code>SqlDialect</code> implementation for the Sqlite database.

Review Comment:
   Please change "the Sqlite database" to "the SQLite database" and make sure 
that "SQLite" is capitalized correctly everywhere that it appears in text.
   
   But the class name, `SqliteSqlDialect` is correct. Class names need to 
follow Calcite policies, and for these purposes "sqlite" is one word.



##########
core/src/main/java/org/apache/calcite/util/RelToSqlConverterUtil.java:
##########
@@ -68,6 +68,41 @@ public static void unparseHiveTrim(
     }
   }
 
+  /**
+   * For usage of TRIM, LTRIM and RTRIM in BQ see
+   * <a 
href="https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#trim";>
+   * BQ Trim Function</a>.
+   */
+  public static void unparseTrim(SqlWriter writer, SqlCall call, int leftPrec,

Review Comment:
   Because you moved the method you need to revisit its javadoc.



##########
core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java:
##########
@@ -9526,8 +9563,11 @@ private void checkLiteral2(String expression, String 
expected) {
         + "from \"foodmart\".\"reserve_employee\"";
     final String expectedStarRocks = "SELECT TRIM(' str ')\n"
         + "FROM `foodmart`.`reserve_employee`";
+    final String expectedSqlite = "SELECT TRIM(' str ')\n"
+        + "FROM \"foodmart\".\"reserve_employee\"";
     sql(query).withStarRocks().ok(expectedStarRocks)
-        .withDoris().ok(expectedStarRocks);
+        .withDoris().ok(expectedStarRocks)

Review Comment:
   Don't add to the end. Add in alphabetical order.
   
   This leads to fewer lines changed, less chance for conflict.



##########
core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java:
##########
@@ -9949,6 +9989,10 @@ Sql withDuckDB() {
       return dialect(DatabaseProduct.DUCKDB.getDialect());
     }
 
+    Sql withSqlite() {
+      return dialect(DatabaseProduct.SQLITE.getDialect());
+    }
+

Review Comment:
   move this method down, into alphabetical order



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to