Reputation: 157
I have this script:
df1 = spark.sql("select * from table where field LIKE '%[0-9]%'")
display(df1)
This gives me empty DF.
I have table contains:
Upvotes: 0
Views: 443
Reputation: 1269953
If you want to return rows where the field has at least one digit, then you should use regular expressions. That is RLIKE
and regular expression syntax:
select *
from table
where field rlike '[0-9]'
None of your fields contain the subquery '[0-9]'
so none match like
, which does not support []
.
Upvotes: 3