zabetak commented on code in PR #3145:
URL: https://github.com/apache/calcite/pull/3145#discussion_r1186452908
##########
slt/README.md:
##########
@@ -0,0 +1,72 @@
+<!--
+{% comment %}
+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.
+{% endcomment %}
+-->
+
+# SQL logic tests
Review Comment:
We are not going to distribute any `slt` binaries as part of Calcite so we
don't need this README.
##########
slt/src/main/java/org/apache/calcite/slt/Main1.java:
##########
@@ -0,0 +1,77 @@
+/*
+ * 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.slt;
+
+import java.io.IOException;
+import java.io.PrintStream;
+import java.net.URL;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+import net.hydromatic.sqllogictest.ExecutionOptions;
+import net.hydromatic.sqllogictest.executors.HsqldbExecutor;
+import net.hydromatic.sqllogictest.executors.NoExecutor;
+import net.hydromatic.sqllogictest.TestLoader;
+
+import org.apache.calcite.slt.executors.CalciteExecutor;
+
+/**
+ * Execute all SqlLogicTest tests.
+ */
+public class Main1 {
Review Comment:
What's the purpose of this class? I don't see it used anywhere.
##########
slt/src/test/java/org/apache/calcite/slt/TestCalcite.java:
##########
@@ -0,0 +1,87 @@
+/*
+ * 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.slt;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.nio.charset.StandardCharsets;
+
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
+public class TestCalcite {
Review Comment:
Probably we need to pick a name that reflects that we are running
`sql-logic-test`; `TestCalcite` is quite general.
##########
slt/src/test/java/org/apache/calcite/slt/TestCalcite.java:
##########
@@ -0,0 +1,87 @@
+/*
+ * 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.slt;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.nio.charset.StandardCharsets;
+
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
+public class TestCalcite {
+ private static final String USAGE = ""
Review Comment:
Is this used? Do we need this?
##########
settings.gradle.kts:
##########
@@ -83,7 +83,8 @@ include(
"spark",
"splunk",
"testkit",
- "ubenchmark"
+ "ubenchmark",
+ "slt"
Review Comment:
I agree with Julian that we don't need a new module; putting the tests in
plus makes sense.
##########
slt/src/main/java/org/apache/calcite/slt/Main1.java:
##########
@@ -0,0 +1,77 @@
+/*
+ * 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.slt;
+
+import java.io.IOException;
+import java.io.PrintStream;
+import java.net.URL;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+import net.hydromatic.sqllogictest.ExecutionOptions;
+import net.hydromatic.sqllogictest.executors.HsqldbExecutor;
+import net.hydromatic.sqllogictest.executors.NoExecutor;
+import net.hydromatic.sqllogictest.TestLoader;
+
+import org.apache.calcite.slt.executors.CalciteExecutor;
+
+/**
+ * Execute all SqlLogicTest tests.
+ */
+public class Main1 {
+ private Main1() {
+ }
+
+ public static void main(String[] argv) throws IOException {
+ execute(true, System.out, System.err, argv);
+ }
+
+ /** As {@link #main} but does not call {@link System#exit} if {@code exit}
+ * is false. */
+ public static int execute(boolean exit, PrintStream out, PrintStream err,
+ String... argv) throws IOException {
+ ExecutionOptions options = new ExecutionOptions(exit, out, err);
+ options.setBinaryName("slt");
+ NoExecutor.register(options);
+ HsqldbExecutor.register(options);
+ CalciteExecutor.register(options);
+ int parse = options.parse(argv);
+ if (parse != 0) {
+ return parse;
+ }
+
+ /*
+ URL r = Thread.currentThread().getContextClassLoader().getResource("test");
+ if (r == null) {
+ out.println("Cannot find resources");
+ return 1;
+ }
+ */
+ URL r = new URL("/home/mbudiu/git/sqllogictest/test");
Review Comment:
This path to a local directory seems really suspicious. I am not sure what's
the purpose of this class but if we really need it we will have to figure a way
to make it work without assuming that test files exist in a local directory.
--
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]