maropu commented on pull request #29009:
URL: https://github.com/apache/spark/pull/29009#issuecomment-654207971
I get a bit confiused and Hive really supports REGEX as a function?
```
// REGEXP case in hive (3.1.1)
hive> SELECT 'abc' REGEXP '([a-z]+)';
OK
true
hive> select REGEXP('abc','([a-z]+)');
NoViableAltException(251@[])
at
org.apache.hadoop.hive.ql.parse.HiveParser_SelectClauseParser.selectClause(HiveParser_SelectClauseParser.java:962)
...
FAILED: ParseException line 1:7 cannot recognize input near 'REGEXP' '('
''abc'' in select clause
// RLIKE in hive
hive> SELECT 'abc' RLIKE '([a-z]+)';
OK
true
hive> select RLIKE('abc','([a-z]+)');
NoViableAltException(265@[])
at
org.apache.hadoop.hive.ql.parse.HiveParser_SelectClauseParser.selectClause(HiveParser_SelectClauseParser.java:962)
...
FAILED: ParseException line 1:7 cannot recognize input near 'RLIKE' '('
''abc'' in select clause
// REGEXP in mysql
mysql> SELECT 'abc' REGEXP '([a-z]+)';
+-------------------------+
| 'abc' REGEXP '([a-z]+)' |
+-------------------------+
| 1 |
+-------------------------+
mysql> select REGEXP('abc','([a-z]+)');
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual
that corresponds to your MySQL server version for the right syntax to use near
'REGEXP('abc','([a-z]+)')' at line 1
// RLIKE in mysql
mysql> SELECT 'abc' RLIKE '([a-z]+)';
+------------------------+
| 'abc' RLIKE '([a-z]+)' |
+------------------------+
| 1 |
+------------------------+
mysql> select RLIKE('abc','([a-z]+)');
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual
that corresponds to your MySQL server version for the right syntax to use near
'RLIKE('abc','([a-z]+)')' at line 1
```
----------------------------------------------------------------
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]