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 中将不再支持传递此类参数.无效的参数是:*参数:()**kwargs: {'query_uri': 'gs://poonamp_pcloud/hive_file1.q'
使用查询参数,我已成功运行配置单元查询(select * from table
)
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
.
这是一个用于查询文件的示例.
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屋!