【问题标题】:Not able to override the input value for Google Cloud Dataproc query无法覆盖 Google Cloud Dataproc 查询的输入值
【发布时间】:2020-06-10 07:30:22
【问题描述】:

我们正在将现有作业从 Hadoop 迁移到 GCP 环境。因此,我们需要将现有的 beeline 命令更改为 Cloud Dataproc。在 Hadoop 环境中,我们使用以下命令查询 Hive 中的表:

beeline -u BEELINE_URL --hivevar HIVE_CORE_DB=$HIVE_CORE_DB --hivevar HIVE_CORE_TBL=$HIVE_CORE_TBL -f table.hql

输入文件table.hql包含以下信息:

select count(*) from ${hivevar:HIVE_CORE_DB}${hivevar:HIVE_CORE_TBL};

当我为 Cloud Dataproc 命令转换相同的代码时,我正在使用以下命令:

gcloud dataproc jobs submit hive --cluster=cluster_name --region=region_name --params HIVE_CORE_DB=$HIVE_CORE_DB --params HIVE_CORE_TBL=$HIVE_CORE_TBL --file=table.hql

table.hql 文件再次包含与之前相同的输入,即

select count(*) from ${hivevar:HIVE_CORE_DB}${hivevar:HIVE_CORE_TBL};

但是,我无法覆盖输入文件 table.hql 中包含的变量的值。

出现以下错误:

错误:编译语句时出错:FAILED:ParseException line 1:15 cannot identify input near '$' '{' 'hivevar' in table name (state=42000,code=40000)

TIA

【问题讨论】:

    标签: google-cloud-platform google-cloud-dataproc


    【解决方案1】:

    您无需在单独的--params 标志下指定输入值,而只需使用一个。

    尝试改变

    --params HIVE_CORE_DB=$HIVE_CORE_DB --params HIVE_CORE_TBL=$HIVE_CORE_TBL

    你的一部分命令

    --params HIVE_CORE_DB=$HIVE_CORE_DB,HIVE_CORE_TBL=$HIVE_CORE_TBL.

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-11-21
      • 1970-01-01
      • 2016-11-12
      • 2016-05-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-05-29
      相关资源
      最近更新 更多