mdayakar commented on code in PR #4965: URL: https://github.com/apache/hive/pull/4965#discussion_r1446463594
########## itests/hive-unit/src/test/java/org/apache/hive/beeline/TestHplSqlViaBeeLine.java: ########## @@ -610,12 +612,268 @@ public void testNullCast() throws Throwable { testScriptFile(SCRIPT_TEXT, args(), "^(.(?!(NullPointerException)))*$", OutStream.ERR); } + @Test + public void testACTIVITY_COUNTHplSqlFunction() throws Throwable { + String SCRIPT_TEXT = + "DROP TABLE IF EXISTS result;\n" + + "CREATE TABLE result (col1 string);\n" + + "INSERT INTO result VALUES('Alice');\n" + + "INSERT INTO result VALUES('Bob');\n" + + "SELECT * FROM result;\n" + + "SELECT ACTIVITY_COUNT;"; + testScriptFile(SCRIPT_TEXT, args(), "2"); + } + + @Test + public void testCASTHplSqlFunction1() throws Throwable { + String SCRIPT_TEXT = "SELECT CAST('Abc' AS CHAR(1));"; + testScriptFile(SCRIPT_TEXT, args(), "A"); + } + + @Test + public void testCASTHplSqlFunction2() throws Throwable { + String SCRIPT_TEXT = "SELECT CAST(TIMESTAMP '2015-03-12 10:58:34.111' AS CHAR(10));"; + testScriptFile(SCRIPT_TEXT, args(), "2015-03-12"); + } + + @Test + public void testCHARHplSqlFunction() throws Throwable { + String SCRIPT_TEXT = "select CHAR(2023)"; + testScriptFile(SCRIPT_TEXT, args(), "2023"); + } + + @Test + public void testCOALESCEHplSQLFunction() throws Throwable { Review Comment: COALESCE function returns first non-null value in the input list. coalesce.sql was covering scenarios like no null value, first param null with only second non-null param, first param null with two non-null params and two null params with one non-null param. All these scenarios can be added to TestHplSqlViaBeeLine.java also, will try to add them also. -- 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: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org