Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 8605B200C70 for ; Thu, 4 May 2017 22:07:09 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8481F160BC4; Thu, 4 May 2017 20:07:09 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C9CDE160B9B for ; Thu, 4 May 2017 22:07:08 +0200 (CEST) Received: (qmail 1757 invoked by uid 500); 4 May 2017 20:07:07 -0000 Mailing-List: contact issues-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list issues@hive.apache.org Received: (qmail 1748 invoked by uid 99); 4 May 2017 20:07:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 May 2017 20:07:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 48D42CD2A9 for ; Thu, 4 May 2017 20:07:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id WYreJrEM9aGH for ; Thu, 4 May 2017 20:07:06 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 2EA125FB32 for ; Thu, 4 May 2017 20:07:06 +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 92074E06CF for ; Thu, 4 May 2017 20:07:05 +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 914E321DEA for ; Thu, 4 May 2017 20:07:04 +0000 (UTC) Date: Thu, 4 May 2017 20:07:04 +0000 (UTC) From: "Thejas M Nair (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-16584) Warning messages should use LogHelper.printInfo instead of printing to the infoStream directly MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 04 May 2017 20:07:09 -0000 [ https://issues.apache.org/jira/browse/HIVE-16584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15997357#comment-15997357 ] Thejas M Nair commented on HIVE-16584: -------------------------------------- +1 Some warnings are missing as a result. Great minds think alike! :) - I had created a partial patch (unverified) yesterday. Pasting it here in case it helps you - {code} diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/CrossProductCheck.java b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/CrossProductCheck.java index 9ad33fdc39..5e0a3eaf6f 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/CrossProductCheck.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/CrossProductCheck.java @@ -128,8 +128,7 @@ public Object dispatch(Node nd, Stack stack, Object... nodeOutputs) } private void warn(String msg) { - SessionState.getConsole().getInfoStream().println( - String.format("Warning: %s", msg)); + SessionState.getConsole().printInfo("Warning: %s" + msg); } private void checkMapJoins(MapRedTask mrTsk) throws SemanticException { diff --git a/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFUnixTimeStamp.java b/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFUnixTimeStamp.java index 118acdc22a..adeb09a5df 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFUnixTimeStamp.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFUnixTimeStamp.java @@ -38,7 +38,6 @@ extended = "Converts the specified time to number of seconds " + "since 1970-01-01. The _FUNC_(void) overload is deprecated, use current_timestamp.") public class GenericUDFUnixTimeStamp extends GenericUDFToUnixTimeStamp { - private static final Logger LOG = LoggerFactory.getLogger(GenericUDFUnixTimeStamp.class); private LongWritable currentTimestamp; // retValue is transient so store this separately. @Override protected void initializeInput(ObjectInspector[] arguments) throws UDFArgumentException { @@ -49,7 +48,7 @@ protected void initializeInput(ObjectInspector[] arguments) throws UDFArgumentEx currentTimestamp = new LongWritable(0); setValueFromTs(currentTimestamp, SessionState.get().getQueryCurrentTimestamp()); String msg = "unix_timestamp(void) is deprecated. Use current_timestamp instead."; - LOG.warn(msg); + SessionState.get().getConsole().printError(msg); PrintStream stream = LogHelper.getInfoStream(); if (stream != null) { stream.println(msg); {code} > Warning messages should use LogHelper.printInfo instead of printing to the infoStream directly > ---------------------------------------------------------------------------------------------- > > Key: HIVE-16584 > URL: https://issues.apache.org/jira/browse/HIVE-16584 > Project: Hive > Issue Type: Bug > Components: Logging > Affects Versions: 3.0.0 > Reporter: Peter Vary > Assignee: Peter Vary > > There are several cases when warning messages are printed to the console outputstream directly. These warnings do not show up in the BeeLine output. > We should use the the printInfo method instead. -- This message was sent by Atlassian JIRA (v6.3.15#6346)