flinksql 流试写入hive 后, hdfs 分区目录有文件生成,但是没有_success文件和 hive中查不到数据,也查不到分区 #1245
Unanswered
Laughingjun
asked this question in
Q&A
Replies: 1 comment
-
我也是同样的问题 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
flinksql 流试写入hive 后, hdfs 分区目录有文件生成,但是没有_success文件和 hive中查不到数据,也查不到分区
CREATE CATALOG myhive WITH (
'type' = 'hive',
'default-database' = 'default',
'hive-conf-dir' = '/usr/hdp/3.1.5.0-152/hive/conf',
'hadoop-conf-dir' = '/usr/hdp/3.1.5.0-152/hadoop/conf'
);
USE CATALOG myhive;
SET table.sql-dialect=hive;
drop table IF EXISTS tb_ods_base_hive_face_detect_rl_demo;
CREATE TABLE IF NOT EXISTS tb_ods_base_hive_face_detect_rl_demo (
person_id STRING,
shot_time BIGINT
) PARTITIONED BY (stat_day STRING) STORED AS parquet TBLPROPERTIES (
'partition.time-extractor.timestamp-pattern'='$stat_day',
'sink.partition-commit.trigger'='partition-time',
'sink.partition-commit.delay'='1 d',
'sink.partition-commit.watermark-time-zone'='Asia/Shanghai',
'sink.partition-commit.policy.kind'='metastore,success-file'
);
SET table.sql-dialect=default;
drop table IF EXISTS QUEUE_ARCHIVE_PERSON_FACE_BUFFER_TABLE;
create table IF NOT EXISTS QUEUE_ARCHIVE_PERSON_FACE_BUFFER_TABLE (
PersonId STRING,
ShotTime BIGINT,-- 20220606101605
ts_ltz AS TO_TIMESTAMP(cast(ShotTime as String), 'yyyyMMddHHmmss'),
WATERMARK FOR ts_ltz AS ts_ltz - INTERVAL '5' SECOND
) with (
'connector' = 'kafka',
'topic' = 'QUEUE_ARCHIVE_PERSON_FACE_BUFFER_TEST',
'properties.bootstrap.servers' = 'ip:9092',
'properties.group.id' = 'archive-person-track_test',
'scan.startup.mode' = 'group-offsets',
'format' = 'json',
'json.fail-on-missing-field' = 'false',
'json.ignore-parse-errors' = 'true'
) ;
INSERT INTO tb_ods_base_hive_face_detect_rl_demo
SELECT PersonId ,ShotTime , DATE_FORMAT(ts_ltz, 'yyyy-MM-dd')
from QUEUE_ARCHIVE_PERSON_FACE_BUFFER_TABLE ;
Beta Was this translation helpful? Give feedback.
All reactions