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 45415200CCA for ; Wed, 5 Jul 2017 02:43:05 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 443A2162173; Wed, 5 Jul 2017 00:43:05 +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 62F2C162172 for ; Wed, 5 Jul 2017 02:43:04 +0200 (CEST) Received: (qmail 30837 invoked by uid 500); 5 Jul 2017 00:43:03 -0000 Mailing-List: contact issues-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.apache.org Delivered-To: mailing list issues@drill.apache.org Received: (qmail 30828 invoked by uid 99); 5 Jul 2017 00:43: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; Wed, 05 Jul 2017 00:43: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 038C81A04D7 for ; Wed, 5 Jul 2017 00:43:03 +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-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id btqiV86K3Gdc for ; Wed, 5 Jul 2017 00:43:01 +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 3B5B05F6C4 for ; Wed, 5 Jul 2017 00:43: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 A30DDE0D39 for ; Wed, 5 Jul 2017 00:43: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 0D9942461E for ; Wed, 5 Jul 2017 00:43:00 +0000 (UTC) Date: Wed, 5 Jul 2017 00:43:00 +0000 (UTC) From: "Pritesh Maker (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DRILL-4755) StringIndexOutOfBoundsException seen with CONVERT_FROM function MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 05 Jul 2017 00:43:05 -0000 [ https://issues.apache.org/jira/browse/DRILL-4755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16074133#comment-16074133 ] Pritesh Maker commented on DRILL-4755: -------------------------------------- [~parthc] can you please review this? > StringIndexOutOfBoundsException seen with CONVERT_FROM function > --------------------------------------------------------------- > > Key: DRILL-4755 > URL: https://issues.apache.org/jira/browse/DRILL-4755 > Project: Apache Drill > Issue Type: Bug > Components: Query Planning & Optimization > Affects Versions: 1.7.0 > Reporter: Khurram Faraaz > Assignee: Volodymyr Vysotskyi > Attachments: date_data.csv > > > StringIndexOutOfBoundsException seen with CONVERT_FROM function > Drill git commit ID : 6286c0a4 > {noformat} > 0: jdbc:drill:schema=dfs.tmp> select CONVERT_FROM(binary_string(columns[0]),'INTEGER') from `binStrDuplcs.csv`; > Error: SYSTEM ERROR: StringIndexOutOfBoundsException: String index out of range: -5 > [Error Id: 7e8fd49d-c6ac-40ac-849e-cf59145ed5dd on centos-01.qa.lab:31010] > (org.apache.drill.exec.work.foreman.ForemanException) Unexpected exception during fragment initialization: String index out of range: -5 > org.apache.drill.exec.work.foreman.Foreman.run():271 > java.util.concurrent.ThreadPoolExecutor.runWorker():1142 > java.util.concurrent.ThreadPoolExecutor$Worker.run():617 > java.lang.Thread.run():745 > Caused By (java.lang.StringIndexOutOfBoundsException) String index out of range: -5 > java.lang.String.substring():1931 > org.apache.drill.exec.planner.logical.PreProcessLogicalRel.getConvertFunctionException():244 > org.apache.drill.exec.planner.logical.PreProcessLogicalRel.visit():148 > org.apache.calcite.rel.logical.LogicalProject.accept():132 > org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.preprocessNode():634 > org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.validateAndConvert():196 > org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan():164 > org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan():94 > org.apache.drill.exec.work.foreman.Foreman.runSQL():978 > org.apache.drill.exec.work.foreman.Foreman.run():257 > java.util.concurrent.ThreadPoolExecutor.runWorker():1142 > java.util.concurrent.ThreadPoolExecutor$Worker.run():617 > java.lang.Thread.run():745 (state=,code=0) > {noformat} > Stack trace from drillbit.log > {noformat} > 2016-06-27 05:31:02,515 [288f45e9-44ad-bc5e-3247-3e0ec4dc68e0:foreman] INFO o.a.drill.exec.work.foreman.Foreman - Query text for query id 288f45e9-44ad-bc5e-3247-3e0ec4dc68e0: select CONVERT_FROM(binary_string(columns[0]),'INTEGER') from `binStrDuplcs.csv` > 2016-06-27 05:31:02,558 [288f45e9-44ad-bc5e-3247-3e0ec4dc68e0:foreman] ERROR o.a.drill.exec.work.foreman.Foreman - SYSTEM ERROR: StringIndexOutOfBoundsException: String index out of range: -5 > [Error Id: 7e8fd49d-c6ac-40ac-849e-cf59145ed5dd on centos-01.qa.lab:31010] > org.apache.drill.common.exceptions.UserException: SYSTEM ERROR: StringIndexOutOfBoundsException: String index out of range: -5 > [Error Id: 7e8fd49d-c6ac-40ac-849e-cf59145ed5dd on centos-01.qa.lab:31010] > at org.apache.drill.common.exceptions.UserException$Builder.build(UserException.java:543) ~[drill-common-1.7.0-SNAPSHOT.jar:1.7.0-SNAPSHOT] > at org.apache.drill.exec.work.foreman.Foreman$ForemanResult.close(Foreman.java:791) [drill-java-exec-1.7.0-SNAPSHOT.jar:1.7.0-SNAPSHOT] > at org.apache.drill.exec.work.foreman.Foreman.moveToState(Foreman.java:901) [drill-java-exec-1.7.0-SNAPSHOT.jar:1.7.0-SNAPSHOT] > at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:271) [drill-java-exec-1.7.0-SNAPSHOT.jar:1.7.0-SNAPSHOT] > at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_91] > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_91] > at java.lang.Thread.run(Thread.java:745) [na:1.8.0_91] > Caused by: org.apache.drill.exec.work.foreman.ForemanException: Unexpected exception during fragment initialization: String index out of range: -5 > ... 4 common frames omitted > Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -5 > at java.lang.String.substring(String.java:1931) ~[na:1.8.0_91] > at org.apache.drill.exec.planner.logical.PreProcessLogicalRel.getConvertFunctionException(PreProcessLogicalRel.java:244) ~[drill-java-exec-1.7.0-SNAPSHOT.jar:1.7.0-SNAPSHOT] > at org.apache.drill.exec.planner.logical.PreProcessLogicalRel.visit(PreProcessLogicalRel.java:148) ~[drill-java-exec-1.7.0-SNAPSHOT.jar:1.7.0-SNAPSHOT] > at org.apache.calcite.rel.logical.LogicalProject.accept(LogicalProject.java:132) ~[calcite-core-1.4.0-drill-r11.jar:1.4.0-drill-r11] > at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.preprocessNode(DefaultSqlHandler.java:634) ~[drill-java-exec-1.7.0-SNAPSHOT.jar:1.7.0-SNAPSHOT] > at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.validateAndConvert(DefaultSqlHandler.java:196) ~[drill-java-exec-1.7.0-SNAPSHOT.jar:1.7.0-SNAPSHOT] > at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan(DefaultSqlHandler.java:164) ~[drill-java-exec-1.7.0-SNAPSHOT.jar:1.7.0-SNAPSHOT] > at org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:94) ~[drill-java-exec-1.7.0-SNAPSHOT.jar:1.7.0-SNAPSHOT] > at org.apache.drill.exec.work.foreman.Foreman.runSQL(Foreman.java:978) [drill-java-exec-1.7.0-SNAPSHOT.jar:1.7.0-SNAPSHOT] > at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:257) [drill-java-exec-1.7.0-SNAPSHOT.jar:1.7.0-SNAPSHOT] > ... 3 common frames omitted > {noformat} > Data used in test > {noformat} > [root@centos-01 ~]# cat binStrDuplcs.csv > '\\x99\\x8c\\x2f\\x77' > '\\x99\\x8c\\x2f\\x77' > '\\x99\\x8c\\x2f\\x77' > '\\x99\\x8c\\x2f\\x77' > '\\x99\\x8c\\x2f\\x77' > '\\x99\\x8c\\x2f\\x77' > '\\x99\\x8c\\x2f\\x77' > '\\x99\\x8c\\x2f\\x77' > '\\x99\\x8c\\x2f\\x77' > '\\x99\\x8c\\x2f\\x77' > '\\x99\\x8c\\x2f\\x77' > '\\x99\\x8c\\x2f\\x77' > '\\x99\\x8c\\x2f\\x77' > '\\x99\\x8c\\x2f\\x77' > '\\x99\\x8c\\x2f\\x77' > '\\x99\\x8c\\x2f\\x77' > {noformat} -- This message was sent by Atlassian JIRA (v6.4.14#64029)