jiefei30 commented on code in PR #3399:
URL: https://github.com/apache/calcite/pull/3399#discussion_r1336011978


##########
babel/src/test/java/org/apache/calcite/test/BabelParserTest.java:
##########
@@ -430,6 +431,23 @@ private void checkParseInfixCast(String sqlType) {
     f.sql("DISCARD TEMP").same();
   }
 
+  @Test void testSparkLeftAntiJoin() {
+    final SqlParserFixture f = fixture().withDialect(SparkSqlDialect.DEFAULT);
+    final String sql = "select a.cid, a.cname, count(1) as amount\n"
+        + "from geo.area1 as a\n"
+        + "left anti join (select distinct cid, cname\n"
+        + "from geo.area2\n"
+        + "where cname = 'cityA') as b on a.cid = b.cid\n"
+        + "group by a.cid, a.cname";
+    final String expected = "SELECT A.CID, A.CNAME, COUNT(1) AMOUNT\n"
+        + "FROM GEO.AREA1 A\n"
+        + "LEFT ANTI JOIN (SELECT DISTINCT CID, CNAME\n"
+        + "FROM GEO.AREA2\n"
+        + "WHERE (CNAME = 'cityA')) B ON (A.CID = B.CID)\n"
+        + "GROUP BY A.CID, A.CNAME";
+    f.sql(sql).ok(expected);

Review Comment:
   According to 
[antlr/grammer](https://github.com/antlr/grammars-v4/tree/master/sql/hive) and 
[apache/hive](https://github.com/apache/hive/blob/master/parser/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g),
 `LEFT ANTI JOIN`  is also supported in `hive4`, but the `hive2` and `hive3` 
are not supported. Should we think that hive also supports this syntax?



-- 
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