在spark中截断jdbc上的配置单元“托管表”

epggiuax  于 2021-06-25  发布在  Hive
关注(0)|答案(0)|浏览(143)

我一直在尝试使用配置单元的托管表截断位于红移集群中的表,但到目前为止没有成功。

CREATE TABLE SPARK_DB.TEST
USING com.databricks.spark.redshift
    OPTIONS (
    dbtable 'reshift_db.test',
    url 'jdbc:redshift://endpoint:5439/db?ssl=true&user=usr&password=pwd',
    tempdir 's3n://mybucket',
    forward_spark_s3_credentials 'true',
    tempformat 'CSV GZIP')

但这将“成功”运行(=无错误),但对底层数据没有影响:truncate table sparkdb.test;
然后我尝试使用托管表的tblproperty,但没有任何效果:

TBLPROPERTIES ("auto.purge"="true")
TBLPROPERTIES ("external"="true")
TBLPROPERTIES ("external.table.purge"="true")
TBLPROPERTIES ("transactional"="true")

如何使spark将这个“截断表”下推到红移,为什么现在不这样做?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题