Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1A0BC11D84 for ; Mon, 9 Jun 2014 17:03:03 +0000 (UTC) Received: (qmail 48039 invoked by uid 500); 9 Jun 2014 17:03:02 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 47997 invoked by uid 500); 9 Jun 2014 17:03:02 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 47922 invoked by uid 99); 9 Jun 2014 17:03:02 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Jun 2014 17:03:02 +0000 Date: Mon, 9 Jun 2014 17:03:02 +0000 (UTC) From: "ASF subversion and git services (JIRA)" To: derby-dev@db.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DERBY-6602) LuceneQueryVTI handles NULL key values inconsistently MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DERBY-6602?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14025360#comment-14025360 ] ASF subversion and git services commented on DERBY-6602: -------------------------------------------------------- Commit 1601440 from [~rhillegas] in branch 'code/trunk' [ https://svn.apache.org/r1601440 ] DERBY-6602: Make the lucene plugin handle null keys; commit derby-6602-01-aa-handleNullKeys.diff. > LuceneQueryVTI handles NULL key values inconsistently > ----------------------------------------------------- > > Key: DERBY-6602 > URL: https://issues.apache.org/jira/browse/DERBY-6602 > Project: Derby > Issue Type: Bug > Components: Tools > Affects Versions: 10.11.0.0 > Reporter: Knut Anders Hatlen > Fix For: 10.11.0.0 > > Attachments: derby-6602-01-aa-handleNullKeys.diff > > > If there's an integer key column with a NULL value, the Lucene query will return a fake key value (0) rather than NULL. The document id and score will be correct. Example: > {noformat} > ij> create table t1(x int, c clob); > 0 rows inserted/updated/deleted > ij> insert into t1 values (null, 'abc'), (null, 'def'); > 2 rows inserted/updated/deleted > ij> call lucenesupport.createindex('app', 't1', 'c', null, 'x'); > 0 rows inserted/updated/deleted > ij> select * from table(t1__c('abc or def', null, 3, null)) tc; > X |DOCUMENTID |SCORE > --------------------------------------- > 0 |0 |0.35355338 > 0 |1 |0.35355338 > 2 rows selected > {noformat} > If the key column is a string type, the returned key is correct (NULL). The document id is sometimes correct and sometimes NULL, and the score seems to be NULL always. Example: > {noformat} > ij> create table t2(x varchar(10), c clob); > 0 rows inserted/updated/deleted > ij> insert into t2 values (null, 'abc'), (null, 'def'); > 2 rows inserted/updated/deleted > ij> call lucenesupport.createindex('app', 't2', 'c', null, 'x'); > 0 rows inserted/updated/deleted > ij> select * from table(t2__c('abc or def', null, 3, null)) tc; > X |DOCUMENTID |SCORE > -------------------------------------- > NULL |NULL |NULL > NULL |1 |NULL > 2 rows selected > {noformat} -- This message was sent by Atlassian JIRA (v6.2#6252)