Error When Creating External Hive Table Via Thrift Server

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Error When Creating External Hive Table Via Thrift Server

Valeriy Trofimov
Hi All,

I'm trying to create and external table using Thrift Server to which I'm connected via Beeline. In order to do this I run the following Hive SQL query, as described here: https://cwiki.apache.org/confluence/display/Hive/Druid+Integration

CREATE EXTERNAL TABLE druid_table_1
STORED BY 'org.apache.hadoop.hive.druid.DruidStorageHandler'
TBLPROPERTIES ("druid.datasource" = "test");

Doing it shows this error:

1: jdbc:hive2://localhost:10000> CREATE EXTERNAL TABLE druid_table_1
1: jdbc:hive2://localhost:10000> STORED BY 'org.apache.hadoop.hive.druid.DruidStorageHandler'
1: jdbc:hive2://localhost:10000> TBLPROPERTIES ("druid.datasource" = "test");
Error: org.apache.spark.sql.catalyst.parser.ParseException:
Operation not allowed: STORED BY(line 2, pos 0)

== SQL ==
CREATE EXTERNAL TABLE druid_table_1
STORED BY 'org.apache.hadoop.hive.druid.DruidStorageHandler'
^^^
TBLPROPERTIES ("druid.datasource" = "test") (state=,code=0)

Googling this error results in this JIRA:


I've tried all the solutions in the JIRA, but none of them worked.

Do you have any advice on how to solve this issue?

Thank you,
Val

Reply | Threaded
Open this post in threaded view
|

Re: Error When Creating External Hive Table Via Thrift Server

Valeriy Trofimov
Hi All,

Ping.

Basically, I need a hint on how to enable HiveSQL support in Spark Thrift Server, instead of using teh default Spark SQL. I need an equivalent of calling SparkSession.enableHiveSupport() if I did it programmmatically.
I cannot do it programmatically, because the project requirements are to use Thrift Server, which for some reason uses Spark SQL instead of HiveQL, which should be a default behavior, because Thrift Server uses Hive.

Thanks,
Val

On Tue, Jul 2, 2019 at 4:34 PM Valeriy Trofimov <[hidden email]> wrote:
Hi All,

I'm trying to create and external table using Thrift Server to which I'm connected via Beeline. In order to do this I run the following Hive SQL query, as described here: https://cwiki.apache.org/confluence/display/Hive/Druid+Integration

CREATE EXTERNAL TABLE druid_table_1
STORED BY 'org.apache.hadoop.hive.druid.DruidStorageHandler'
TBLPROPERTIES ("druid.datasource" = "test");

Doing it shows this error:

1: jdbc:hive2://localhost:10000> CREATE EXTERNAL TABLE druid_table_1
1: jdbc:hive2://localhost:10000> STORED BY 'org.apache.hadoop.hive.druid.DruidStorageHandler'
1: jdbc:hive2://localhost:10000> TBLPROPERTIES ("druid.datasource" = "test");
Error: org.apache.spark.sql.catalyst.parser.ParseException:
Operation not allowed: STORED BY(line 2, pos 0)

== SQL ==
CREATE EXTERNAL TABLE druid_table_1
STORED BY 'org.apache.hadoop.hive.druid.DruidStorageHandler'
^^^
TBLPROPERTIES ("druid.datasource" = "test") (state=,code=0)

Googling this error results in this JIRA:


I've tried all the solutions in the JIRA, but none of them worked.

Do you have any advice on how to solve this issue?

Thank you,
Val

Reply | Threaded
Open this post in threaded view
|

回复:Error When Creating External Hive Table Via Thrift Server

huanqinghappy-2
Maybe you can confirm the code of your spark version. Hive support is enable by default.
------------------------------------------------------------------
发件人:Valeriy Trofimov <[hidden email]>
发送时间:2019年7月4日(星期四) 04:05
收件人:dev <[hidden email]>
主 题:Re: Error When Creating External Hive Table Via Thrift Server

Hi All,

Ping.

Basically, I need a hint on how to enable HiveSQL support in Spark Thrift Server, instead of using teh default Spark SQL. I need an equivalent of calling SparkSession.enableHiveSupport() if I did it programmmatically.
I cannot do it programmatically, because the project requirements are to use Thrift Server, which for some reason uses Spark SQL instead of HiveQL, which should be a default behavior, because Thrift Server uses Hive.

Thanks,
Val

On Tue, Jul 2, 2019 at 4:34 PM Valeriy Trofimov <[hidden email]> wrote:
Hi All,

I'm trying to create and external table using Thrift Server to which I'm connected via Beeline. In order to do this I run the following Hive SQL query, as described here: https://cwiki.apache.org/confluence/display/Hive/Druid+Integration

CREATE EXTERNAL TABLE druid_table_1
STORED BY 'org.apache.hadoop.hive.druid.DruidStorageHandler'
TBLPROPERTIES ("druid.datasource" = "test");

Doing it shows this error:

1: jdbc:hive2://localhost:10000> CREATE EXTERNAL TABLE druid_table_1
1: jdbc:hive2://localhost:10000> STORED BY 'org.apache.hadoop.hive.druid.DruidStorageHandler'
1: jdbc:hive2://localhost:10000> TBLPROPERTIES ("druid.datasource" = "test");
Error: org.apache.spark.sql.catalyst.parser.ParseException:
Operation not allowed: STORED BY(line 2, pos 0)

== SQL ==
CREATE EXTERNAL TABLE druid_table_1
STORED BY 'org.apache.hadoop.hive.druid.DruidStorageHandler'
^^^
TBLPROPERTIES ("druid.datasource" = "test") (state=,code=0)

Googling this error results in this JIRA:


I've tried all the solutions in the JIRA, but none of them worked.

Do you have any advice on how to solve this issue?

Thank you,
Val