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 42D4D200D06 for ; Mon, 25 Sep 2017 10:06:07 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 400EB1609C4; Mon, 25 Sep 2017 08:06:07 +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 850E41609BB for ; Mon, 25 Sep 2017 10:06:06 +0200 (CEST) Received: (qmail 85829 invoked by uid 500); 25 Sep 2017 08:06:05 -0000 Mailing-List: contact issues-help@spark.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@spark.apache.org Received: (qmail 85820 invoked by uid 99); 25 Sep 2017 08:06:05 -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; Mon, 25 Sep 2017 08:06:05 +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 0127FDB89D for ; Mon, 25 Sep 2017 08:06:05 +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-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id TlFx6xknT1bK for ; Mon, 25 Sep 2017 08:06:04 +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 A70885FB62 for ; Mon, 25 Sep 2017 08:06:03 +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 0A967E0B21 for ; Mon, 25 Sep 2017 08:06:03 +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 C57D724219 for ; Mon, 25 Sep 2017 08:06:01 +0000 (UTC) Date: Mon, 25 Sep 2017 08:06:01 +0000 (UTC) From: "Liang-Chi Hsieh (JIRA)" To: issues@spark.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (SPARK-22113) Dataset shows in Hive is inconsistent with JDBC MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 25 Sep 2017 08:06:07 -0000 [ https://issues.apache.org/jira/browse/SPARK-22113?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16178698#comment-16178698 ] Liang-Chi Hsieh commented on SPARK-22113: ----------------------------------------- Hmm, actually we have the API {{def select(col: String, cols: String*): DataFrame}}. So I think it doesn't select a string literal. Actually I found the reason why the second JDBC-based query fails. I just wonder if we should connect Hive with jdbc. [~Michael Fu] Where is the spark-sql document you mentioned? > Dataset shows in Hive is inconsistent with JDBC > ----------------------------------------------- > > Key: SPARK-22113 > URL: https://issues.apache.org/jira/browse/SPARK-22113 > Project: Spark > Issue Type: Bug > Components: SQL > Affects Versions: 2.2.0 > Environment: version 2.2.0 > Reporter: Michael Fu > > I am trying to query data from Hive in spark. According spark-sql document, there're two ways to do this: > The first way is Init session with _enableHiveSupport_ > {code:java} > SparkSession session = SparkSession.builder().enableHiveSupport().getOrCreate(); > session.sql("select dw_date from tfdw.dwd_dim_date limit 10").show(); > {code} > the dataset shows the correct result > !https://i.stack.imgur.com/gBJCj.png! > The second way is through JDBC > {code:java} > Dataset ds = session.read() > .format("jdbc") > .option("driver", "org.apache.hive.jdbc.HiveDriver") > .option("url", "jdbc:hive2://iZ11syxr6afZ:21050/;auth=noSasl") > .option("dbtable", "tfdw.dwd_dim_date") > .load(); > ds.select("dw_date").limit(10).show(); > {code} > But the dataset only show the column name in the result rather than the data in the column > !https://i.stack.imgur.com/FBMDN.png! > The two pictures should be consistent I think. Any outstanding I missed ? Many thanks! -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org For additional commands, e-mail: issues-help@spark.apache.org