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 BC208200C5D for ; Thu, 23 Mar 2017 18:27:48 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id BA4B9160B68; Thu, 23 Mar 2017 17:27:48 +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 1CBC5160B83 for ; Thu, 23 Mar 2017 18:27:47 +0100 (CET) Received: (qmail 96376 invoked by uid 500); 23 Mar 2017 17:27:47 -0000 Mailing-List: contact dev-help@phoenix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@phoenix.apache.org Delivered-To: mailing list dev@phoenix.apache.org Received: (qmail 96310 invoked by uid 99); 23 Mar 2017 17:27:47 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Mar 2017 17:27:47 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 850C91889DF for ; Thu, 23 Mar 2017 17:27:46 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -98.549 X-Spam-Level: X-Spam-Status: No, score=-98.549 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_NEUTRAL=0.652, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id et15qNi3Md21 for ; Thu, 23 Mar 2017 17:27:45 +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 07F9C5FAD2 for ; Thu, 23 Mar 2017 17:27:44 +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 94702E0959 for ; Thu, 23 Mar 2017 17:27:42 +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 C8BF221DBE for ; Thu, 23 Mar 2017 17:27:41 +0000 (UTC) Date: Thu, 23 Mar 2017 17:27:41 +0000 (UTC) From: "Nan Xu (JIRA)" To: dev@phoenix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (PHOENIX-3751) spark 2.1 with Phoenix 4.10 load data as dataframe fail, NullPointerException MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 23 Mar 2017 17:27:48 -0000 [ https://issues.apache.org/jira/browse/PHOENIX-3751?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Nan Xu updated PHOENIX-3751: ---------------------------- Summary: spark 2.1 with Phoenix 4.10 load data as dataframe fail, NullPointerException (was: spark 2.1 with Phoenix 4.10 load data as dataframe fail) > spark 2.1 with Phoenix 4.10 load data as dataframe fail, NullPointerException > ----------------------------------------------------------------------------- > > Key: PHOENIX-3751 > URL: https://issues.apache.org/jira/browse/PHOENIX-3751 > Project: Phoenix > Issue Type: Bug > Affects Versions: 4.10.0 > Environment: HBase 1.14 > spark 2.10 > phoenix: 4.10 > Reporter: Nan Xu > > create phoenix table: > create table phoenix.quote ( > sym Varchar not null, > src varchar, > kdbPublishTime time not null, > location varchar, > bid DOUBLE, > ask DOUBLE, > bsize unsigned_int, > asize unsigned_int, > srcTime time, > layer varchar, > expiryTime time, > quoteId varchar, > recvTime time, > distTime time, > "TIME" time > CONSTRAINT quote_pk PRIMARY KEY (sym, src, kdbPublishTime)) COMPRESSION='SNAPPY', DATA_BLOCK_ENCODING='FAST_DIFF', VERSIONS=1000 > insert data: > SYM SRC KDBPUBLISHTIME LOCATION BID ASK BSIZE ASIZE SRCTIME LAYER EXPIRYTIME QUOTEID RECVTIME DISTTIME TIME > 6AH7 cme1 03:42:59 N 0.7471 0.7506 20 25 03:42:59 (null) (null) (null) 03:42:59 (null) 03:42:59 > 6AH7 cme1 03:42:59 N 0.7474 0.7506 25 25 03:42:59 (null) (null) (null) 03:42:59 (null) 03:42:59 > val spark = SparkSession > .builder() > .appName("load_avro") > .master("local[1]") > .config("spark.sql.warehouse.dir", "file:/tmp/spark-warehouse") > .getOrCreate() > val df = spark.sqlContext.phoenixTableAsDataFrame("PHOENIX.QUOTE", Seq("SYM","SRC", "EXPIRYTIME"), zkUrl = Some("a1.cluster:2181")) > df.show(100) > problem is in PhoenixRDD:140 > val rowSeq = columns.map { case (name, sqlType) => > val res = pr.resultMap(name) > // Special handling for data types > if (dateAsTimestamp && (sqlType == 91 || sqlType == 19)) { // 91 is the defined type for Date and 19 for UNSIGNED_DATE > new java.sql.Timestamp(res.asInstanceOf[java.sql.Date].getTime) > } else if (sqlType == 92 || sqlType == 18) { // 92 is the defined type for Time and 18 for UNSIGNED_TIME > new java.sql.Timestamp(res.asInstanceOf[java.sql.Time].getTime) > } else { > res > } > } > res.asInstanceOf[java.sql.Time].getTime could be null and get NPE. -- This message was sent by Atlassian JIRA (v6.3.15#6346)