Return-Path: X-Original-To: apmail-lucene-dev-archive@www.apache.org Delivered-To: apmail-lucene-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 0E9E6494B for ; Fri, 10 Jun 2011 07:35:24 +0000 (UTC) Received: (qmail 82590 invoked by uid 500); 10 Jun 2011 07:35:22 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 82527 invoked by uid 500); 10 Jun 2011 07:35:22 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 82246 invoked by uid 99); 10 Jun 2011 07:35:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Jun 2011 07:35:22 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Jun 2011 07:35:20 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 21CC110CDB8 for ; Fri, 10 Jun 2011 07:34:59 +0000 (UTC) Date: Fri, 10 Jun 2011 07:34:59 +0000 (UTC) From: "Thomas Gambier (JIRA)" To: dev@lucene.apache.org Message-ID: <1993699160.9986.1307691299134.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1740793727.26597.1305812747536.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Resolved] (SOLR-2529) DIH update trouble with sql field name "pk" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/SOLR-2529?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Thomas Gambier resolved SOLR-2529. ---------------------------------- Resolution: Fixed Fix Version/s: 4.0 I've made some test on unreleased version 4.0 and it works well with a deltaQuery like : "SELECT pk AS id FROM..." Where "id" is the name of my primary key in DIH config. TY > DIH update trouble with sql field name "pk" > ------------------------------------------- > > Key: SOLR-2529 > URL: https://issues.apache.org/jira/browse/SOLR-2529 > Project: Solr > Issue Type: Bug > Components: contrib - DataImportHandler > Affects Versions: 3.1, 3.2 > Environment: Debian Lenny, JRE 6 > Reporter: Thomas Gambier > Priority: Blocker > Fix For: 4.0 > > > We are unable to use the DIH when database columnName primary key is named "pk". > The reported solr error is : > "deltaQuery has no column to resolve to declared primary key pk='pk'" > We have made some investigations and found that the DIH have a mistake when it's looking for the primary key between row's columns list. > private String findMatchingPkColumn(String pk, Map row) { > if (row.containsKey(pk)) > throw new IllegalArgumentException( > String.format("deltaQuery returned a row with null for primary key %s", pk)); > String resolvedPk = null; > for (String columnName : row.keySet()) { > if (columnName.endsWith("." + pk) || pk.endsWith("." + columnName)) { > if (resolvedPk != null) > throw new IllegalArgumentException( > String.format( > "deltaQuery has more than one column (%s and %s) that might resolve to declared primary key pk='%s'", > resolvedPk, columnName, pk)); > resolvedPk = columnName; > } > } > if (resolvedPk == null) > throw new IllegalArgumentException( > String.format("deltaQuery has no column to resolve to declared primary key pk='%s'", pk)); > LOG.info(String.format("Resolving deltaQuery column '%s' to match entity's declared pk '%s'", resolvedPk, pk)); > return resolvedPk; > } -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org