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 97658200C53 for ; Tue, 11 Apr 2017 10:51:16 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 95D63160B9B; Tue, 11 Apr 2017 08:51:16 +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 8E328160B89 for ; Tue, 11 Apr 2017 10:51:15 +0200 (CEST) Received: (qmail 11557 invoked by uid 500); 11 Apr 2017 08:51:14 -0000 Mailing-List: contact dev-help@polygene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@polygene.apache.org Delivered-To: mailing list dev@polygene.apache.org Received: (qmail 11540 invoked by uid 99); 11 Apr 2017 08:51:14 -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; Tue, 11 Apr 2017 08:51:14 +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 04E2C18FCE2 for ; Tue, 11 Apr 2017 08:51:14 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.48 X-Spam-Level: ** X-Spam-Status: No, score=2.48 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com 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 3pZm5pyZRTtO for ; Tue, 11 Apr 2017 08:51:10 +0000 (UTC) Received: from mail-lf0-f41.google.com (mail-lf0-f41.google.com [209.85.215.41]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id B165F5F5A2 for ; Tue, 11 Apr 2017 08:51:09 +0000 (UTC) Received: by mail-lf0-f41.google.com with SMTP id s141so47647435lfe.3 for ; Tue, 11 Apr 2017 01:51:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to; bh=sYxY8TEIJK5y+QaSR3DEghfV+paluBMzxX6hgwqxuT0=; b=OAHAuVSpoVwN0WhV0pjdm0FzlwkacVHQC6lZ8/umzJcwiEjvY4wq5jVMfFnns7wE2S 9yuTy6RudM7CjcLKlKQ9zvc4hMbAa7KWeRvrzkp1IrdJlkJUOHVDXlqMeIoHPvKYVYgV EwoWp33iXiUuMcMqHrmMKBaA1xbWaofRBud4GyrC1cGCoyKDzIaxlXfaRZZ3TyzS69XI uJTS5b1cr1+xZF4tp8UCoLjBtkCm6e7d5KobI3Z/Bz6Szam/41CWQtADNF0JHqR/6e4N OvxHkdyomNUL2UDQgxfCFSOwqR7U5IHSVGIV2oG5E+vURdBESfmXDHbF2vgk8vkm5U9D vuUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=sYxY8TEIJK5y+QaSR3DEghfV+paluBMzxX6hgwqxuT0=; b=MIYZxDNnVwXpXBCBsrBBz9CP7+bDytITWPK+so08ffmhVwj1qOv/Jx/CER+7hXuNgo kvY7vZQNs0CW4YiZ+8koPBc7ysRs+OWpPHOeB0H8u7PJiumnprfNxPqgczIAiNopPvBt F41AVOEZzT6nQM1/qXJIb53zCZZFCudUVSltf1fm4kWjNMDFx3U9Lp54zQswgFwJkX1e W4mcagoETtPQ89TdMPf0i3T+VAZuaDPCnSizF3GL5UUFbkm4bVPDoFqcFQ4+cSLb9h7R 1brCjOyeYQijEMlBcAJr4P+ZyPpCBTSvDhTSQ74ozWCVgG/T4aPDk5sHE975lEqKunUi EEOA== X-Gm-Message-State: AN3rC/6+cEaIOp2VEj2BG3pCSKCKcfZnnHYMup7adOZ8ONh8LznK+2oTBlqTzm0DApr65wRmmq9ck1RvAkXzSQ== X-Received: by 10.25.219.203 with SMTP id t72mr3226838lfi.42.1491900669012; Tue, 11 Apr 2017 01:51:09 -0700 (PDT) MIME-Version: 1.0 Sender: hedhman@gmail.com Received: by 10.46.22.27 with HTTP; Tue, 11 Apr 2017 01:50:48 -0700 (PDT) In-Reply-To: <641f6a2b-8c60-2ef5-ae82-9adbbfdc6335@zest.mail.kapsi.fi> References: <58E27E03.50601@apache.org> <641f6a2b-8c60-2ef5-ae82-9adbbfdc6335@zest.mail.kapsi.fi> From: Niclas Hedhman Date: Tue, 11 Apr 2017 16:50:48 +0800 X-Google-Sender-Auth: 3WlI1lt8KCsvZvr2rGCBXhx9FOs Message-ID: Subject: Re: Sorting out issues with Indexing SQL To: dev@polygene.apache.org, stanislav.muhametsin@zest.mail.kapsi.fi Content-Type: multipart/alternative; boundary=94eb2c1851906aae73054ce031da archived-at: Tue, 11 Apr 2017 08:51:16 -0000 --94eb2c1851906aae73054ce031da Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable No, that is actually not the problem. It is that the CompositeDescriptor of types found in declared properties are determined by interfaces only, and not looked up in the model. And it remains like that "forever", so it is an issue in the model/design, that was a consequence that wasn't realized when the dynamic addition of the type took place. It is apparent that indexing-sql is approaching this slightly different than indexing-rdf and indexing-elasticsearch, but I am not convinced that it does the wrong thing.. basically checking "these primitive types and ValueComposites are allowed"... which seems rational enough to me. Cheers On Tue, Apr 11, 2017 at 4:36 PM, Stanislav Muhametsin < stanislav.muhametsin@zest.mail.kapsi.fi> wrote: > Sorry about being inactive - weekend completely booked. > But glad to hear that you have located the issue, Niclas! > > Could it be that indexing-sql tries to access type information about > compoties "too soon"? > If the core does the type adding in some place after extension-related > code has already run... ? > > > On 10.4.2017 15:34, Paul Merlin wrote: > >> Awesome! >> Sorry if I contributed to that mess:/ >> >> >> Le 2017-04-10 13:49, Niclas Hedhman a =C3=A9crit : >> >>> I think I have located another "problem" in the indexing-sql >>> implementation. And it has probably never worked. >>> >>> I am looking at >>> org.apache.polygene.test.indexing.AbstractQueryTest#script29, which >>> tries >>> to search for a person that has "http" field in the URL of its >>> personalWebsite. >>> >>> The startup code correctly traverse the types and sets up tables for al= l >>> the qnames. >>> >>> But during Indexing, I am getting this; >>> >>> WARN o.a.p.i.s.s.s.SQLCompatEntityStateWrapper - Unsupported Property >>> type: public abstract >>> org.apache.polygene.api.property.Property >>> >>> org.apache.polygene.test.model.Person.personalWebsite() >>> >>> which is the "reason" why properties within that Value type are not >>> indexed. >>> >>> Ok, so what is causing this? >>> >>> org/apache/polygene/index/sql/support/skeletons/SQLCompatEntityStateWra= pper.java:64 >>> >>> retrieves the valueType() from propertyDescriptor and on >>> org/apache/polygene/index/sql/support/skeletons/SQLCompatEntityStateWra= pper.java:91 >>> >>> it checks if that is an instanceof ValueCompositeType, which it is not. >>> Q.E.D >>> >>> But why is that? >>> >>> For instance, the propertyDescriptor for >>> >>> @Optional >>> Property
address(); >>> >>> is correct. But >>> >>> @Optional >>> Property personalWebsite(); >>> >>> is invalid (URL is a test specific type and not java.net.URL). And the >>> difference between Address and URL is that the former extends >>> ValueComposite and latter doesn't. >>> >>> So, the reason seems to be exactly POLYGENE-137, i.e. fixed in RDF >>> (elsewhere?) but wasn't fixed for indexing-sql. Unfortunately, no notes >>> left behind on POLYGENE-137. And Paul's >>> commit 7c2814ee145e91088ab6859147ef41c1d1ef8abe on 2 March 2017 mention= s >>> the POLYGENE-137 but a lot of other stuff in it at the same time. >>> >>> >>> Ok, further... The ValueType that is provided, doesn't have >>> ValueComposite >>> in its types, as I would have expected. So why then, is ValueType not >>> populated with ValueComposite, as I would have expected? Could it be th= at >>> TypeLookup cuts some corners, or is it the whole model is doing somethi= ng >>> unexpected and doesn't build up all the descriptors correctly? Well, I = am >>> not sure, and I will try to figure that out tomorrow. >>> >>> At least, I have located what this particular problem (script29) is all >>> about, and there is some hope that other test cases are failing for sam= e >>> reason. >>> >>> >>> Cheers >>> >>> On Tue, Apr 4, 2017 at 6:17 PM, Niclas Hedhman >>> wrote: >>> >>> Thanks, I will try to dig into this. Worst case, we take indexing-sql o= ff >>>> the release specification. >>>> >>>> On Tue, Apr 4, 2017 at 5:26 PM, Stanislav Muhametsin < >>>> stanislav.muhametsin@zest.mail.kapsi.fi> wrote: >>>> >>>> On 4.4.2017 11:03, Niclas Hedhman wrote: >>>>> >>>>> Indexing-SQL scans whole application structure on startup to detect a= ll >>>>>> >>>>>>> >>>>>>> the visible and indexable entity composite types, and if the things >>>>>> changed >>>>>> there, it might cause problems. >>>>>> >>>>>> Oy! Do you remember How/Where is that done? Because the >>>>>> EntityComposite >>>>>> type is added to the EntityDescriptor and must be done that way (or >>>>>> the >>>>>> Entity object with instanceof) and not be checking the Java >>>>>> interfaces. >>>>>> That could be the root of many problems. >>>>>> >>>>>> >>>>> It is "constructApplicationInfo" method in >>>>> "extensions/indexing-sql/src/m >>>>> ain/java/org/apache/polygene/index/sql/support/skeletons/Abs >>>>> tractSQLStartup.java". >>>>> However, I am looking at it (via GitHub - still no Java IDE here), an= d >>>>> it >>>>> doesn't _seem_ to use direct type check - it uses EntityDescriptors >>>>> instead. >>>>> You still might wanna make sure that it actually works as needed. >>>>> >>>>> Unfortunately, I couldn't find the code which emits "unsupported >>>>> property >>>>> type" messages (no text-content-search in Github :( ), but putting a >>>>> breakpoint in there might reveal something crucial. >>>>> I am very certain that I didn't get any of those when I got >>>>> Indexing-SQL >>>>> working back in the days. >>>>> >>>>> >>>>> >>>>> >>>>> The other change is that identity is now a type and not String, and >>>>>> somewhere that might cause problems. >>>>>> >>>>>> >>>>>> Rewrite; Yeah, I have been considering this for a while. And perhaps >>>>>> build >>>>>> something by leveraging QueryDSL (http://www.querydsl.com/), or at >>>>>> least >>>>>> borrow internals for it. But I concluded that it was more work than >>>>>> fit >>>>>> into 3.0 plan. But I would be really happy to get to a situation >>>>>> where we >>>>>> have "ES backed indexer", which would help a lot going forward. The >>>>>> RDF >>>>>> implementation is also getting "old"... >>>>>> >>>>>> Cheers >>>>>> Niclas >>>>>> >>>>>> On Tue, Apr 4, 2017 at 3:15 PM, Stanislav Muhametsin < >>>>>> stanislav.muhametsin@zest.mail.kapsi.fi> wrote: >>>>>> >>>>>> Hi! >>>>>> >>>>>>> >>>>>>> Hmm yeah, it's been quite a while since I wrote that beast. :D I >>>>>>> would >>>>>>> do >>>>>>> a lot of things differently now, but I guess we are stuck with what >>>>>>> we >>>>>>> have >>>>>>> (until someone rewrites that). >>>>>>> >>>>>>> There was a discussion in October 2016, and I am not sure if the >>>>>>> issue >>>>>>> discussed then has been resolved, or maybe is (partially) the cause >>>>>>> for >>>>>>> errors. >>>>>>> I will copy-paste my reply I wrote in October at the end of this >>>>>>> mail. >>>>>>> >>>>>>> Looking at that issue link ( https://issues.apache.org/jira >>>>>>> /browse/POLYGENE-222 ), there might be something in detection of >>>>>>> entity >>>>>>> composite types - looks like "the first bad commit" was something >>>>>>> about >>>>>>> entity composite types no longer needing to extend EntityComposite >>>>>>> interface? >>>>>>> Indexing-SQL scans whole application structure on startup to detect >>>>>>> all >>>>>>> the visible and indexable entity composite types, and if the things >>>>>>> changed >>>>>>> there, it might cause problems. >>>>>>> >>>>>>> The other commits are more unfamiliar territory for me - looking at >>>>>>> attached test report, I think the most important information is the >>>>>>> standard output. >>>>>>> There is a bunch of "unsupported property type" messages - are >>>>>>> associations and manyassociations in Polygene just Property<..> the= se >>>>>>> days? >>>>>>> That definetly will break things in Indexing-SQL. >>>>>>> It is a bit hard to follow for me since so many things have changed >>>>>>> in >>>>>>> Polygene now (which is also a good thing - a sign of development!). >>>>>>> >>>>>>> Here is the copy-paste from October. >>>>>>> It seems that the problem was Indexing-SQL not recognizing "Identit= y" >>>>>>> type >>>>>>> as primitive (something like 'String' or 'Integer'). >>>>>>> >>>>>>> -------- BEGIN QUOTED MAIL -------- >>>>>>> In "extensions/indexing-sql/src/main/java/org/apache/zest/index >>>>>>> /sql/support/skeletons/AbstractSQLStartup.java" file, there is >>>>>>> "initTypes" method. >>>>>>> You might want to add mapping for Identity.class in >>>>>>> this._primitiveTypes >>>>>>> and jdbcTypes, and also most likely this._customizableTypes. >>>>>>> >>>>>>> I say "might" want to, since I have really really vague memories on >>>>>>> how >>>>>>> that worked, and I realized I don't have any PC right now with Java >>>>>>> coding >>>>>>> environment set up. >>>>>>> The "appendColumnDefinitionsForProperty" method in the same file >>>>>>> uses >>>>>>> the >>>>>>> type mappings mentioned above to deduce what kind of column is to b= e >>>>>>> created for property, which might be the issue here. >>>>>>> >>>>>>> Also, you probably want to modify the "/extensions/indexing-sql/src= / >>>>>>> main/java/org/apache/zest/index/sql/support/common/QNameInfo.java" >>>>>>> file, >>>>>>> so that the detection whether some Java type is primitive is update= d >>>>>>> to >>>>>>> include Identity. >>>>>>> It is done just before setting this._isFinalTypePrimitive. >>>>>>> >>>>>>> Let us know if this is of any help to you. >>>>>>> -------- END QUOTED MAIL -------- >>>>>>> >>>>>>> >>>>>>> On 03/04/2017 19:53, Paul Merlin wrote: >>>>>>> >>>>>>> Stan, Niclas, >>>>>>> >>>>>>>> >>>>>>>> Indexing SQL has been broken for quite some time. >>>>>>>> See https://issues.apache.org/jira/browse/POLYGENE-222 >>>>>>>> >>>>>>>> That issue contains the result of bisecting the history to identif= y >>>>>>>> when >>>>>>>> it broke. With the Docker based testing infra it is now very easy = to >>>>>>>> reproduce. >>>>>>>> >>>>>>>> Stan, you wrote that beast :) >>>>>>>> Niclas, one commit of yours broke that beast :) >>>>>>>> >>>>>>>> Could you have a look? >>>>>>>> >>>>>>>> Thanks! >>>>>>>> >>>>>>>> /Paul >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>> >>>>> >>>> >>>> -- >>>> Niclas Hedhman, Software Developer >>>> http://polygene.apache.org - New Energy for Java >>>> >>>> >> > --=20 Niclas Hedhman, Software Developer http://polygene.apache.org - New Energy for Java --94eb2c1851906aae73054ce031da--