我期待在列中具有特殊字符[a-zA-Z0-9]的Hive中選擇行。在Hive尋找選擇列中具有特殊字符的行
我不太清楚如何構建WHERE子句,但是基於其他線程我想這應該是這個樣子:
SELECT DISTINCT user_name
FROM user_info
WHERE user_name like regexp_extract('%[^a-zA-Z\d\s:]%')
但蜂巢提供了這個錯誤:
Error while compiling statement: FAILED: SemanticException [Error 10014]: Line 3:21 Wrong arguments ''%[^a-zA-Z\d\s:]%'': No matching method for class org.apache.hadoop.hive.ql.udf.UDFRegExpExtract with (string). Possible choices: FUNC(string, string) FUNC(string, string, int)
如何我應該設置regexp_extract子句嗎?
感謝
這並沒有產生一個錯誤,但並沒有產生我所期待的結果。仍在測試。謝謝你,因爲我並沒有意識到這個特徵。 – Jazzmine
工程很好 - 絕對是這個問題的解決方案。謝謝 – Jazzmine