mustafaiman commented on a change in pull request #2059:
URL: https://github.com/apache/hive/pull/2059#discussion_r599158246



##########
File path: hplsql/src/test/queries/local/conversion.sql
##########
@@ -0,0 +1,61 @@
+declare a BIGINT = 3;
+declare b DECIMAL = 4;
+declare c DOUBLE = 5;
+declare s STRING = 'abc';
+
+-- add
+a + a;
+a + b;
+a + c;
+
+b + b;
+b + a;
+b + c;
+
+c + c;
+c + a;
+c + b;
+s + s;
+
+-- sub
+a - a;
+a - b;
+a - c;
+
+b - b;
+b - a;
+b - c;
+
+c - c;
+c - a;
+c - b;
+
+-- mul
+a * a;
+a * b;
+a * c;
+
+b * b;
+b * a;
+b * c;
+
+c * c;
+c * a;
+c * b;
+
+-- div
+a / a;
+a / b;
+a / c;
+
+b / b;
+b / (a - 2);
+b / c;
+
+c / c;
+c / a;
+c / b;
+
+-- error
+
+'apple' / 3;

Review comment:
       addition is also supported for string, right? Let us add that too.

##########
File path: hplsql/src/main/java/org/apache/hive/hplsql/SyntaxErrorReporter.java
##########
@@ -0,0 +1,50 @@
+/*
+ *  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.hive.hplsql;
+
+import java.util.BitSet;
+
+import org.antlr.v4.runtime.BaseErrorListener;
+import org.antlr.v4.runtime.Parser;
+import org.antlr.v4.runtime.RecognitionException;
+import org.antlr.v4.runtime.Recognizer;
+import org.antlr.v4.runtime.atn.ATNConfigSet;
+import org.antlr.v4.runtime.dfa.DFA;
+
+public class SyntaxErrorReporter extends BaseErrorListener {
+  private final Console console;
+
+  public SyntaxErrorReporter(Console console) {
+    this.console = console;
+  }
+
+  @Override
+  public void syntaxError(Recognizer<?, ?> recognizer, Object offendingSymbol, 
int line, int charPositionInLine, String msg, RecognitionException e) {
+    console.printError("Syntax error at line " + line + ":" + 
charPositionInLine + " " + msg);
+  }
+
+  public void reportAmbiguity(Parser recognizer, DFA dfa, int startIndex, int 
stopIndex, boolean exact, BitSet ambigAlts, ATNConfigSet configs) {

Review comment:
       Empty overrides are still 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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to