Search code examples
hivehiveql

Hive SQL is giving extraneous input ',' expecting ')' error


My Hive SQL code is as follows:

  FROM (
      SELECT *, CONCAT_WS('__', ) AS no_hash_join_key
        FROM xyz.e_6445
       WHERE p_m_id = '{MARKET_ID}'
         AND p_date = '{RUN_DATE_YYYY-MM-DD}'
  ) dataforge

I am getting the following error:

 extraneous input ',' expecting ')'

I am failing to understand what is causing the error. I tried changing it to the following:

SELECT *, CONCAT_WS('__', ' ' )

This removes the given error but results in a different error :

 INSERT_SQL_COLUMN_MISMATCH

What am I doing wrong? Any help would be appreciated.


Solution

  • You have a blank parameter in concat_ws. Get rid of the comma (or pass another parameter)