Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flinksql方式从kafka中导入数据到hive 作业无法执行 #219

Closed
zhangxiao696 opened this issue Jul 2, 2021 · 9 comments
Closed

Comments

@zhangxiao696
Copy link

CREATE TABLE kafka_input(
id BIGINT,
name STRING,
event_time STRING,
num BIGINT
)
WITH (
'connector' = 'kafka',
'topic' = 'xiao_test_1',
'properties.bootstrap.servers' = 'xxxxx:9092',
'properties.group.id' = 'testGroup',
'scan.startup.mode' = 'latest-offset',
'format' = 'json'
);

CREATE CATALOG myhive WITH (
'type' = 'hive',
'default-database' = 'xiao_test_1',
'hive-conf-dir' = '/home/work/hive/hive/conf/'
);

SET table.sql-dialect=hive;

INSERT INTO stg_test_hive_table
SELECT
id,
name as name_desc,
event_time,
num,
CAST(TO_DATE(CAST(LOCALTIMESTAMP AS VARCHAR)) AS VARCHAR) as dt
FROM kafka_input;

图片

图片

请问这是什么情况?

@weimzh
Copy link
Contributor

weimzh commented Jul 3, 2021

原因是由于使用了jdk11
换用jdk8就可以了

@phillip2019
Copy link
Contributor

原因是由于使用了jdk11 换用jdk8就可以了

请问对应的pom配置和sql怎么写的?

@phillip2019
Copy link
Contributor

CREATE TABLE kafka_input( id BIGINT, name STRING, event_time STRING, num BIGINT ) WITH ( 'connector' = 'kafka', 'topic' = 'xiao_test_1', 'properties.bootstrap.servers' = 'xxxxx:9092', 'properties.group.id' = 'testGroup', 'scan.startup.mode' = 'latest-offset', 'format' = 'json' );

CREATE CATALOG myhive WITH ( 'type' = 'hive', 'default-database' = 'xiao_test_1', 'hive-conf-dir' = '/home/work/hive/hive/conf/' );

SET table.sql-dialect=hive;

INSERT INTO stg_test_hive_table SELECT id, name as name_desc, event_time, num, CAST(TO_DATE(CAST(LOCALTIMESTAMP AS VARCHAR)) AS VARCHAR) as dt FROM kafka_input;

图片 图片

请问这是什么情况?

请问这个解决了吗,如何解决的?

@phillip2019
Copy link
Contributor

已解决,配置文件缺失metastore.uri,添加上即可

@yixinGod
Copy link

请问streamx如何使用创建的 catalog,
执行 set catalog myhive 报sql解析错
image

@rcf666
Copy link

rcf666 commented Jul 11, 2022

请问streamx如何使用创建的 catalog, 执行 set catalog myhive 报sql解析错 image

请问这个问题解决了吗 我创建hivecatelog报这个错
image

@yixinGod
Copy link

image
完整的大概是这样,我用的是1.2.1的版本

@rcf666
Copy link

rcf666 commented Jul 11, 2022

image 完整的大概是这样,我用的是1.2.1的版本

image 完整的大概是这样,我用的是1.2.1的版本

谢谢老哥 能加个微信吗 还有点问题

@growJie
Copy link

growJie commented May 16, 2023

请问streamx如何使用创建的 catalog, 执行 set catalog myhive 报sql解析错 image

请问这个问题解决了吗 我创建hivecatelog报这个错 image

请问一下,这个问题你解决了吗?我现在也遇到了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants