mihaibudiu commented on code in PR #4019:
URL: https://github.com/apache/calcite/pull/4019#discussion_r1818186391
##########
core/src/test/java/org/apache/calcite/test/UdfTest.java:
##########
@@ -423,7 +447,8 @@ private CalciteAssert.AssertThat withUdf() {
@Test void testUdfOverloadedNullable() {
final CalciteAssert.AssertThat with = withUdf();
- with.query("values (\"adhoc\".count_args(),\n"
+ with.with(SqlConformanceEnum.MYSQL_5)
Review Comment:
why is this change needed?
##########
core/src/main/java/org/apache/calcite/prepare/CalciteCatalogReader.java:
##########
@@ -283,7 +283,7 @@ private static SqlMonikerImpl moniker(CalciteSchema schema,
@Nullable String nam
* or classes.
*
* @see ModelHandler#addFunctions */
- public static SqlOperatorTable operatorTable(String... classNames) {
+ public SqlOperatorTable operatorTable(String... classNames) {
Review Comment:
why remove the static?
##########
core/src/main/java/org/apache/calcite/prepare/CalciteCatalogReader.java:
##########
@@ -303,7 +303,7 @@ public static SqlOperatorTable operatorTable(String...
classNames) {
}
/** Converts a function to a {@link org.apache.calcite.sql.SqlOperator}. */
- private static SqlOperator toOp(SqlIdentifier name,
+ private SqlOperator toOp(SqlIdentifier name,
Review Comment:
here as well
##########
plus/src/main/java/org/apache/calcite/chinook/CalciteConnectionProvider.java:
##########
@@ -44,6 +44,7 @@ public Properties provideConnectionInfo() throws IOException {
Properties info = new Properties();
info.setProperty("lex", "MYSQL");
info.setProperty("model", "inline:" + provideSchema());
+ info.setProperty("conformance", "MYSQL_5");
Review Comment:
why is this change needed?
##########
core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedFunction.java:
##########
@@ -61,9 +64,9 @@ public SqlUserDefinedFunction(SqlIdentifier opName, SqlKind
kind,
SqlReturnTypeInference returnTypeInference,
SqlOperandTypeInference operandTypeInference,
@Nullable SqlOperandMetadata operandMetadata,
- Function function) {
+ Function function, SqlSyntax syntax) {
Review Comment:
you cannot change public constructors - this is a breaking change for
clients.
you have to keep this constructor, and add another one.
##########
testkit/src/main/java/org/apache/calcite/util/Smalls.java:
##########
@@ -683,6 +683,13 @@ public static int eval(int x) throws
IllegalArgumentException, IOException {
}
}
+ /** User-defined function with niladic parentheses. */
+ public static class MyNiladicParenthesesFunction {
+ public String eval() {
Review Comment:
please add a comment explaining that this function returns the constant
string "foo".
##########
testkit/src/main/java/org/apache/calcite/test/CalciteAssert.java:
##########
@@ -205,6 +205,10 @@ private CalciteAssert() {}
return this;
}
+ @Override public AssertThat with(SqlConformanceEnum conformance) {
Review Comment:
what happens here?
--
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]