hive sql error: ParseException in subquery source
org.apache.hadoop.hive.ql.parse.ParseException:line 368:18 cannot recognize input near ‘group’ ‘by’ ‘order_phone_num’ in subquery source
sql:
customer_Flag as (
select order_phone_num,
concat_ws(';', collect_list(c)) as a,
sum(customer_flag) as b
from (
select order_phone_num,
customer_flag,
concat_ws(',', collect_list(cast(r_diff as string))) as c
from add_payment_period
group by order_phone_num,
customer_flag
)
group by order_phone_num
),
Solution: give the outermost group by order_phone_Num plus an alias C1
customer_Flag as (
select order_phone_num,
concat_ws(';', collect_list(c)) as a,
sum(customer_flag) as b
from (
select order_phone_num,
customer_flag,
concat_ws(',', collect_list(cast(r_diff as string))) as c
from add_payment_period
group by order_phone_num,
customer_flag
) c1
group by order_phone_num
),
Read More:
- Dbeaver connects hive to solve the problem that hive custom UDF functions cannot be used in SQL queries in dbeaver
- [Modified] Hive SQL Error: SQL ERROR [10004] [42000]: Error while compiling statement: FAILED: SemanticException [Error
- View’s select contains a subquery in the from clause bug
- [Solved] java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corres
- Bulk Update Error: #Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the m
- java.sql.SQLException: Disk full (/tmp/#sql_1eaa2_60.MAI); waiting for someone to free some space
- [Linux Docker Mirror] MYSQL Run sql Script Error: Failed to open file ‘/home/mydatabase.sql‘, error: 2
- Introduction to Relational Databases in SQL
- Hive install initialization error: Error: Duplicate key name ‘PCS_STATS_IDX‘ (state=42000,code=1061)
- [Solved] SQL Error: Method queryTotal execution error of sql
- IDEA hive connect jdbc error [How to Solve]
- [Solved] pymysql.err.ProgrammingError: (1064, ‘You have an error in your SQL syntax;
- Error 1064 (42000): you have an error in your SQL syntax
- MySQL Change password failure prompt: ERROR 1064(42000):You have an error in your SQL syntax: check the corresponds to your M
- ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your
- [Solved Perfectly] MySQL ERROR 1064 (42000): You have an error in your SQL syntax;
- Mysql 8.0.13 Enabling remote access (ERROR 1064 (42000): You have an error in your SQL syntax; check the manual th)
- MYSQL Use cmd to change root password error: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual tha
- [Solved] Caused by: java.sql.SQLException: Access denied for user ‘root‘@‘hadoop102‘ (using password: YES)
- [Solved] Hive Find Error: FAILED: RuntimeException java.lang.RuntimeException: cannot find field