I am trying to run simplest query. However it is not working. -bash-4.2$ prestosql –execute “select 1;” Exception in thread “main” io.airlift.airline.ParseArgumentsUnexpectedException: Found …
Tag: hive
Hive – Merge rows with search term substrings
I got a search results log table with search terms in one of the columns. Since the search results are produced as the user types in the search terms, there are multiple rows for each search term with the partial string. For example, as the user types world the resulting rows in the table will be: Expected results: I’m using
left join in hive
would anyone kindly answer the question below? Is left join outer join or inner join in hive? (Do we need to type left “outer” join in order to do the outer join? or simply left join works as outer?) Answer Just like in most, if not all, databases, the outer word is optional in left [outer] join, while both syntaxs
Hive – find 2 characters anywhere in the string/row – RLIKE
How do I get the data for ONLY “_WA” data assigned to “USA_RBB_WA_BU”? However the column I look at has rows that contain _WA and _SA (USA_CA_SAWANT) I used, select…. …
Convert from lateral view to case statements in hive
I need to place below code in case statement: I have tried: But getting error. Answer For the provided SQL on table tab1, the actual logic is like: Explode field secondary.tertiary, alias it as lv, which results in a temporary result set (table) tab2; A join-like operation to concatenate tab2’s fields back to rows in tab1, resulting in another intermediate
Add missing monthly rows
I would like to list the missing date between two dates in a request for example My data : YEAR_MONTH | AMOUNT 202001 | 500 202001 | 600 201912 | 100 201910 | 200 201910 | …
Dynamically frame Filter condition based on conditions
We have separate table maintained for condition / filters. Based on the conditions, filters to be applied at base table. here’s the sample input conditional data for reference purpose Based on this input conditions , filter to be derived as follows. please help me in achieving the filter query Answer The below sparkSQL will help you to build the where
Why I am getting error while performing group by in hive?
I am executing below command in hive: Select child.data_volume_gprs_dl + child.data_volume_gprs_ul as data_usage, parent.file_name, parent.record_number from table1 as parent left …
AnalysisException: No matching function with signature: rtrim(VARCHAR(40), STRING)
I have the value of 58.3308% in the table(include % character), I need output of 0.583308, and the SQL query as below works fine in SQL console But I get this error in my python code, it’s a hive/impala problem, right? AnalysisException: No matching function with signature: rtrim(VARCHAR(40), STRING) Thanks so much for any advice Answer As per Hive manual,
Search for exact string value in JSON
I have a column stored in JSON that looks like column name: s2s_payload Values: I want to query exact values in the array rather than returning all values for a certain data type. I was using JSON_EXTRACT to get distinct counts. If I want to filter where “”eventtype””:””search”” how can I do this? I tried using CAST(s2s_payload AS CHAR) =