Dataproc Hive运算符未运行存储在存储桶中的hql文件 [英] Dataproc hive operator not running hql file stored in storage bucket
问题描述
我正在尝试使用气流脚本运行云存储中存在的hql文件,我们可以通过两个参数将路径传递给DataprocHiveOperator:
I am trying to run hql file present in cloud storage using airflow script,there are two parameters through which we can pass the path to DataprocHiveOperator :
- 查询:'gs://bucketpath/filename.q'
发生错误-无法识别'gs'附近的输入':''/'
- query_uri:'gs ://bucketpath/filename.q'
发生错误:PendingDeprecationWarning:无效的参数已传递给DataProcHiveOperator。在Airflow 2.0中将不再支持传递此类参数。无效的参数为:
* args:()
** kwargs:{'query_uri':'gs://poonamp_pcloud/hive_file1.q'
使用查询参数,我已成功运行配置单元查询(从表中选择*
)
Using Query param , i have successfully run hive queries(select * from table
)
是否可以通过dataprochiveoperator运行存储在云存储桶中的hql文件?
推荐答案
这是因为您同时使用了 query
和 query_uri
强>。
That's because you are using both query
as well as query_uri
.
如果使用文件查询,则必须使用 query_uri
和 query = None
或您可以忽略编写查询。
如果您使用的是 内联查询
,则必须使用 query
。
If you are querying using a file, you have to use query_uri
and query = None
OR you can ignore writing query.
If you are using inline query
then you have to use query
.
以下是查询文件的示例。< br>
Here is a sample for querying through a file.
HiveInsertingTable = DataProcHiveOperator(task_id='HiveInsertingTable',
gcp_conn_id='google_cloud_default',
queri_ury="gs://us-central1-bucket/data/sample_hql.sql",
cluster_name='cluster-name',
region='us-central1',
dag=dag)
这篇关于Dataproc Hive运算符未运行存储在存储桶中的hql文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!