From commits-return-14134-archive-asf-public=cust-asf.ponee.io@airflow.incubator.apache.org Mon Apr 23 18:57:04 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 21AAE180634 for ; Mon, 23 Apr 2018 18:57:03 +0200 (CEST) Received: (qmail 3253 invoked by uid 500); 23 Apr 2018 16:57:03 -0000 Mailing-List: contact commits-help@airflow.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airflow.incubator.apache.org Delivered-To: mailing list commits@airflow.incubator.apache.org Received: (qmail 3244 invoked by uid 99); 23 Apr 2018 16:57:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Apr 2018 16:57:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id AC0911A1BE7 for ; Mon, 23 Apr 2018 16:57:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -101.511 X-Spam-Level: X-Spam-Status: No, score=-101.511 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id U1mCm5P0wmZm for ; Mon, 23 Apr 2018 16:57:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 4E9295F188 for ; Mon, 23 Apr 2018 16:57:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 8A5D0E0383 for ; Mon, 23 Apr 2018 16:57:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 4EA72241C6 for ; Mon, 23 Apr 2018 16:57:00 +0000 (UTC) Date: Mon, 23 Apr 2018 16:57:00 +0000 (UTC) From: "ASF subversion and git services (JIRA)" To: commits@airflow.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (AIRFLOW-1153) params in HiveOperator constructor can't be passed into Hive execution context MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AIRFLOW-1153?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16448436#comment-16448436 ] ASF subversion and git services commented on AIRFLOW-1153: ---------------------------------------------------------- Commit 09bbe247728993867c716635951219cc49f65dd1 in incubator-airflow's branch refs/heads/master from Alan Ma [ https://git-wip-us.apache.org/repos/asf?p=incubator-airflow.git;h=09bbe24 ] [AIRFLOW-1153] Allow HiveOperators to take hiveconfs HiveOperator can only replace variables via jinja and the replacements are global to the dag through the context and user_defined_macros. It would be much more flexible to open up hive_conf to the HiveOperator level so hive scripts can be recycled at the task level, leveraging HiveHook already existing hive_conf param and _prepare_hiveconf function. Closes #3136 from wolfier/AIRFLOW-1153 > params in HiveOperator constructor can't be passed into Hive execution context > ------------------------------------------------------------------------------ > > Key: AIRFLOW-1153 > URL: https://issues.apache.org/jira/browse/AIRFLOW-1153 > Project: Apache Airflow > Issue Type: Bug > Components: hive_hooks, operators > Affects Versions: Airflow 2.0, Airflow 1.8 > Reporter: Xianping lin > Priority: Critical > Labels: easyfix, newbie > > params parameter in HiveOperator can't be imported into Hive executation context. > so the following centence won't work, because 'mynumber' doesn't work for sql sentence. > test_hiveoperator = HiveOperator( > task_id='hive_test', > hiveconf_jinja_translate=True, > hql = ''' use myDB; > INSERT OVERWRITE TABLE t2 > select * from t1 where t1.x > ' ${hiveconf:mynumber}' > ''', > params={'mynumber': 2}, > dag=dag > ) > this modification pass the 'params' in HiveOperator construction to Hive sql execution context. > The the variable definition can pass to hive sql -- This message was sent by Atlassian JIRA (v7.6.3#76005)