You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spark.apache.org by Valeriy Trofimov <va...@gmail.com> on 2019/07/02 23:34:57 UTC

Error When Creating External Hive Table Via Thrift Server

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:

https://jira.mongodb.org/browse/HADOOP-301

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

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

Posted by huanqinghappy <hu...@aliyun.com.INVALID>.
Maybe you can confirm the code of your spark version. Hive support is enable by default.
------------------------------------------------------------------
发件人:Valeriy Trofimov <va...@gmail.com>
发送时间:2019年7月4日(星期四) 04:05
收件人:dev <de...@spark.apache.org>
主 题: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 <va...@gmail.com> 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:

https://jira.mongodb.org/browse/HADOOP-301 
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


Re: Error When Creating External Hive Table Via Thrift Server

Posted by Valeriy Trofimov <va...@gmail.com>.
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 <va...@gmail.com>
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:
>
> https://jira.mongodb.org/browse/HADOOP-301
>
> 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
>
>