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 21772200C5B for ; Tue, 4 Apr 2017 15:29:47 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 20079160B81; Tue, 4 Apr 2017 13:29:47 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (unknown [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6E308160B90 for ; Tue, 4 Apr 2017 15:29:46 +0200 (CEST) Received: (qmail 41691 invoked by uid 500); 4 Apr 2017 13:29:45 -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 41676 invoked by uid 99); 4 Apr 2017 13:29:45 -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; Tue, 04 Apr 2017 13:29:45 +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 187BC1A0427 for ; Tue, 4 Apr 2017 13:29:45 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-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 (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id q6InAhNI4jPg for ; Tue, 4 Apr 2017 13:29:44 +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 80D815FCD7 for ; Tue, 4 Apr 2017 13:29:43 +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 BBD72E0185 for ; Tue, 4 Apr 2017 13:29: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 963DC2401C for ; Tue, 4 Apr 2017 13:29:41 +0000 (UTC) Date: Tue, 4 Apr 2017 13:29:41 +0000 (UTC) From: "Josh Mahonin (JIRA)" To: dev@phoenix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (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: Tue, 04 Apr 2017 13:29:47 -0000 [ https://issues.apache.org/jira/browse/PHOENIX-3751?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15955127#comment-15955127 ] Josh Mahonin commented on PHOENIX-3751: --------------------------------------- +1 > 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 > Assignee: Ankit Singhal > Fix For: 4.11.0 > > Attachments: PHOENIX-3751.patch > > > 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)