mdayakar commented on code in PR #4965:
URL: https://github.com/apache/hive/pull/4965#discussion_r1444240588


##########
hplsql/src/main/java/org/apache/hive/hplsql/functions/FunctionString.java:
##########
@@ -33,38 +33,30 @@ public FunctionString(Exec e, QueryExecutor queryExecutor) {
   public void register(BuiltinFunctions f) {
     f.map.put("CONCAT", this::concat);
     f.map.put("CHAR", this::char_);
-    f.map.put("INSTR", this::instr);
     f.map.put("LEN", this::len);
-    f.map.put("LENGTH", this::length);
-    f.map.put("LOWER", this::lower);
-    f.map.put("REPLACE", this::replace);
-    f.map.put("SUBSTR", this::substr);
-    f.map.put("SUBSTRING", this::substr);
     f.map.put("TO_CHAR", this::toChar);
     f.map.put("UPPER", this::upper);
-    
-    f.specMap.put("SUBSTRING", this::substring);
-    f.specMap.put("TRIM", this::trim);

Review Comment:
   > I suppose the reason for removing SUBSTRING, TRIM and a few other 
functions is that these are builtin functions in Hive.
   Yes Aman.
   
   > so is HPL/SQL going to forward the function call to HS2 ?
   Yes, in this case it will just forward the function call to HS2
   
   > One thing we should verify is if the HPL/SQL behavior of these functions 
is the same as what the Hive built-in function does or is there any small 
difference.
   Yes Aman, if there is any behaviour change or some extra feature for any 
function then that code is not removed. Actually for SUBSTRING also later found 
that it supports another functionality 'SUBSTRING(string FROM start_pos [FOR 
substring_len])' which is not present in HS2 so added back the SUBSTRING 
function code. Similar for CONCAT (if any param is NULL then HS2 returns NULL 
as output where as HPLSQL function ignores NULLs and concats other non-null 
strings) so this function also not removed.
   
   >  I am curious why these were implemented in HPL/SQL in the first place 
since these are SQL standard functions.
   As per my understanding HPLSQL initially provided as a separate entity (not 
part of Hive) and later it got merged as a part of Hive. When it was a separate 
entity, it can be used not only with Hive also can be with any other Databases 
like DB2, MySQL,... so they might provided implementation for all these 
functions now its part of Hive release so I assumed it can be used only with 
Hive so I removed the functions implementation which are already supported in 
Hive.
   
   > Was there additional precondition checks being done or any other variants 
that HPL/SQL supported that Hive did not ?
   The code is already present and I could see there are some precondition 
checks present.
   



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

Reply via email to