Support Questions

Find answers, ask questions, and share your expertise

Ambari Hive View: HiveSQLException ParseException mismatched input

avatar
Explorer

I'm trying to upload a table in the Ambari Hive View. The file is tab separated and the strings are delimited by double quotes (I have set these settings in the appropriated dialog box in the upload form).

There is always an exception, no matter what variations of the input file I try (different field delimiter, with and without header row, ...):

    java.lang.Exception: org.apache.hive.service.cli.HiveSQLException: Error while compiling statement: FAILED: ParseException line 1:77 mismatched input ',' expecting ( near 'CHAR' in primitive type specification

java.lang.Exception: org.apache.hive.service.cli.HiveSQLException: Error while compiling statement: FAILED: ParseException line 1:77 mismatched input ',' expecting ( near 'CHAR' in primitive type specification
	at org.apache.ambari.view.hive2.resources.jobs.JobService.getOne(JobService.java:141)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)

(...)

I'm running this in the HDP Sandbox deployed in Azure.

Sandbox information:
Created on: 25_10_2016_08_11_26 for
Hadoop stack version:  Hadoop 2.7.3.2.5.0.0-1245
Ambari Version: 2.4.0.0-1225
Ambari Hash: 59175b7aa1ddb74b85551c632e3ce42fed8f0c85
Ambari build:  Release : 1225
Java version:  1.8.0_111
OS Version:  CentOS release 6.8 (Final)

Any suggestion on how to solve this?

1 ACCEPTED SOLUTION

avatar
Explorer

Thank you for the replies.

After further analysis, I found the root of the problem. It was required to set the length of CHAR columns. The user interface has a widget to set this value, however it appearance is similar to a disabled component, instead of an input field, which is misleading.

View solution in original post

6 REPLIES 6

avatar
Explorer

I did another test: I downloaded an example existing in the Sandbox (cdrs.txt) and repeated the process. It also gave an error (a different one, however). So, the problem shouldn't be the file itself.

java.lang.Exception: org.apache.hive.service.cli.HiveSQLException: Error while compiling statement: FAILED: ParseException line 1:61 Failed to recognize predicate 'LOCAL'. Failed rule: 'identifier' in column specification

java.lang.Exception: org.apache.hive.service.cli.HiveSQLException: Error while compiling statement: FAILED: ParseException line 1:61 Failed to recognize predicate 'LOCAL'. Failed rule: 'identifier' in column specification
	at org.apache.ambari.view.hive2.resources.jobs.JobService.getOne(JobService.java:141)

avatar

Are you using "local" in your query, it seems to be a reserved word, can you rename it to something else and try?

avatar
Explorer

The used sample data is from the example included in the HDP Sandbox. So it should be correct. Anyway, renaming the column names leads to the same result.

avatar
Expert Contributor

Please find error for this column

  1. java.lang.Exception: org.apache.hive.service.cli.HiveSQLException:Errorwhile compiling statement: FAILED:ParseException line 1:77 mismatched input ',' expecting ( near 'CHAR'in primitive type specification

avatar
Explorer

Yes, the error should be there, as the exception says 🙂

avatar
Explorer

Thank you for the replies.

After further analysis, I found the root of the problem. It was required to set the length of CHAR columns. The user interface has a widget to set this value, however it appearance is similar to a disabled component, instead of an input field, which is misleading.