[ 
https://issues.apache.org/jira/browse/IGNITE-7960?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Vasiliy Sisko updated IGNITE-7960:
----------------------------------
    Description: 
1) On run of demo mode in Web console in Queries page for every query showed 
error. F.e.:
Error: Table "CAR" not found.
After debug I notice that org.h2.schema.Schema#tablesAndViews map contains key 
with type name stored as "Car". In that case query parser require "CAR" name 
and query fail.
Caches created by invocation of java config 
org.apache.ignite.Ignite#getOrCreateCaches

2) I create simple reproducer (See files TestQuery.java and Country.java), but 
metadata and parser in that case use the same name "Car". 
Caches created by invocation of java config 
org.apache.ignite.Ignite#getOrCreateCaches
Added reproducer. See [^reproducer.zip]. Run RunFirst.java, stop RunFirst. run 
RunFirst.java again then run RunSecond.java. Second class try to execute query 
and print error.

3) Configured in XML cache has normalised name of type "CAR". In that case 
parser too require "CAR" name and work without error.
Caches created in process of cluster activation.
Base cache config:
{code}
    <bean id="tester_cache" abstract="true" 
class="org.apache.ignite.configuration.CacheConfiguration">
        <property name="statisticsEnabled" value="true"/>
        <property name="queryDetailMetricsSize" value="10"/>
        <property name="affinity">
            <bean 
class="org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction">
                <property name="partitions" value="10"/>
            </bean>
        </property>
    </bean>
{code}
Partitioned cache config:
{code}
    <bean id="default_partitioned" abstract="true" parent="tester_cache">
        <property name="name" value="DEFAULT"/>
        <property name="cacheMode" value="PARTITIONED"/>
        <property name="writeSynchronizationMode" value="PRIMARY_SYNC"/>
        <property name="backups" value="1"/>
        <property name="indexedTypes">
            <list>
                <value>java.lang.Integer</value>
                <value>java.lang.String</value>
            </list>
        </property>
        <property name="sqlFunctionClasses">
            <list>
               <value>org.ignite.sql.VisorTesterSQLFunctionsClass</value>
                <value>org.ignite.sql.VisorTesterSQLMathFunctionsClass</value>
                <value>org.ignite.sql.VisorTesterSQLStrFunctionsClass</value>
            </list>
        </property>
    </bean>
{code}
Final cache config:
{code}
    <bean id="c_partitioned2" abstract="true" parent="default_partitioned">
        <property name="name" value="c_partitioned2"/>

        <property name="indexedTypes">
            <list>
                <value>java.util.UUID</value>
                <value>org.ignite.sql.Car</value>
            </list>
        </property>

        <property name="queryEntities">
            <list>
                <bean class="org.apache.ignite.cache.QueryEntity">
                    <property name="keyType" value="org.ignite.sql.AddressKey"/>
                    <property name="valueType" value="org.ignite.sql.Address"/>

                    <property name="keyFields">
                        <list>
                            <value>pk</value>
                        </list>
                    </property>

                    <property name="fields">
                        <map>
                            <entry key="pk" value="java.lang.Integer"/>
                            <entry key="street" value="java.lang.String"/>
                            <entry key="zip" value="java.lang.Integer"/>
                        </map>
                    </property>

                    <property name="indexes">
                        <list>
                            <bean class="org.apache.ignite.cache.QueryIndex">
                                <property name="name" value="ZIP_DESC_IDX"/>
                                <property name="fields">
                                    <map>
                                        <entry key="zip" value="false"/>
                                    </map>
                                </property>
                                <property name="indexType" value="SORTED"/>
                            </bean>
                            <bean class="org.apache.ignite.cache.QueryIndex">
                                <property name="name" value="STREET_TXT_IDX"/>
                                <property name="fields">
                                    <map>
                                        <entry key="street" value="true"/>
                                    </map>
                                </property>
                                <property name="indexType" value="FULLTEXT"/>
                            </bean>
                            <bean class="org.apache.ignite.cache.QueryIndex">
                                <property name="name" value="GRP_IDX"/>
                                <property name="fields">
                                    <map>
                                        <entry key="street" value="true"/>
                                        <entry key="zip" value="true"/>
                                    </map>
                                </property>
                                <property name="indexType" value="SORTED"/>
                            </bean>
                        </list>
                    </property>
                </bean>
                <bean class="org.apache.ignite.cache.QueryEntity">
                    <property name="keyType" value="org.ignite.sql.CountryKey"/>
                    <property name="valueType" 
value="org.ignite.sql.CountryVal"/>

                    <property name="keyFields">
                        <list>
                            <value>pk</value>
                        </list>
                    </property>

                    <property name="fields">
                        <map>
                            <entry key="pk" value="java.lang.Integer"/>
                            <entry key="name" value="java.lang.String"/>
                            <entry key="population" value="java.lang.Integer"/>
                        </map>
                    </property>

                    <property name="indexes">
                        <list>
                            <bean class="org.apache.ignite.cache.QueryIndex">
                                <property name="name" 
value="Country_name_ppl_IDX"/>
                                <property name="fields">
                                    <map>
                                        <entry key="name" value="true"/>
                                        <entry key="population" value="false"/>
                                    </map>
                                </property>
                                <property name="indexType" value="SORTED"/>
                            </bean>
                        </list>
                    </property>
                </bean>
            </list>
        </property>
    </bean>
{code}

  was:
1) On run of demo mode in Web console in Queries page for every query showed 
error. F.e.:
Error: Table "CAR" not found.
After debug I notice that org.h2.schema.Schema#tablesAndViews map contains key 
with type name stored as "Car". In that case query parser require "CAR" name 
and query fail.
Caches created by invocation of java config 
org.apache.ignite.Ignite#getOrCreateCaches

2) I create simple reproducer (See files TestQuery.java and Country.java), but 
metadata and parser in that case use the same name "Car". 
Caches created by invocation of java config 
org.apache.ignite.Ignite#getOrCreateCaches
Added reproducer. See [^reproducer.zip]. Run RunFirst.java and then run 
RunSecond.java. Second class try to execute query and print error.

3) Configured in XML cache has normalised name of type "CAR". In that case 
parser too require "CAR" name and work without error.
Caches created in process of cluster activation.
Base cache config:
{code}
    <bean id="tester_cache" abstract="true" 
class="org.apache.ignite.configuration.CacheConfiguration">
        <property name="statisticsEnabled" value="true"/>
        <property name="queryDetailMetricsSize" value="10"/>
        <property name="affinity">
            <bean 
class="org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction">
                <property name="partitions" value="10"/>
            </bean>
        </property>
    </bean>
{code}
Partitioned cache config:
{code}
    <bean id="default_partitioned" abstract="true" parent="tester_cache">
        <property name="name" value="DEFAULT"/>
        <property name="cacheMode" value="PARTITIONED"/>
        <property name="writeSynchronizationMode" value="PRIMARY_SYNC"/>
        <property name="backups" value="1"/>
        <property name="indexedTypes">
            <list>
                <value>java.lang.Integer</value>
                <value>java.lang.String</value>
            </list>
        </property>
        <property name="sqlFunctionClasses">
            <list>
               <value>org.ignite.sql.VisorTesterSQLFunctionsClass</value>
                <value>org.ignite.sql.VisorTesterSQLMathFunctionsClass</value>
                <value>org.ignite.sql.VisorTesterSQLStrFunctionsClass</value>
            </list>
        </property>
    </bean>
{code}
Final cache config:
{code}
    <bean id="c_partitioned2" abstract="true" parent="default_partitioned">
        <property name="name" value="c_partitioned2"/>

        <property name="indexedTypes">
            <list>
                <value>java.util.UUID</value>
                <value>org.ignite.sql.Car</value>
            </list>
        </property>

        <property name="queryEntities">
            <list>
                <bean class="org.apache.ignite.cache.QueryEntity">
                    <property name="keyType" value="org.ignite.sql.AddressKey"/>
                    <property name="valueType" value="org.ignite.sql.Address"/>

                    <property name="keyFields">
                        <list>
                            <value>pk</value>
                        </list>
                    </property>

                    <property name="fields">
                        <map>
                            <entry key="pk" value="java.lang.Integer"/>
                            <entry key="street" value="java.lang.String"/>
                            <entry key="zip" value="java.lang.Integer"/>
                        </map>
                    </property>

                    <property name="indexes">
                        <list>
                            <bean class="org.apache.ignite.cache.QueryIndex">
                                <property name="name" value="ZIP_DESC_IDX"/>
                                <property name="fields">
                                    <map>
                                        <entry key="zip" value="false"/>
                                    </map>
                                </property>
                                <property name="indexType" value="SORTED"/>
                            </bean>
                            <bean class="org.apache.ignite.cache.QueryIndex">
                                <property name="name" value="STREET_TXT_IDX"/>
                                <property name="fields">
                                    <map>
                                        <entry key="street" value="true"/>
                                    </map>
                                </property>
                                <property name="indexType" value="FULLTEXT"/>
                            </bean>
                            <bean class="org.apache.ignite.cache.QueryIndex">
                                <property name="name" value="GRP_IDX"/>
                                <property name="fields">
                                    <map>
                                        <entry key="street" value="true"/>
                                        <entry key="zip" value="true"/>
                                    </map>
                                </property>
                                <property name="indexType" value="SORTED"/>
                            </bean>
                        </list>
                    </property>
                </bean>
                <bean class="org.apache.ignite.cache.QueryEntity">
                    <property name="keyType" value="org.ignite.sql.CountryKey"/>
                    <property name="valueType" 
value="org.ignite.sql.CountryVal"/>

                    <property name="keyFields">
                        <list>
                            <value>pk</value>
                        </list>
                    </property>

                    <property name="fields">
                        <map>
                            <entry key="pk" value="java.lang.Integer"/>
                            <entry key="name" value="java.lang.String"/>
                            <entry key="population" value="java.lang.Integer"/>
                        </map>
                    </property>

                    <property name="indexes">
                        <list>
                            <bean class="org.apache.ignite.cache.QueryIndex">
                                <property name="name" 
value="Country_name_ppl_IDX"/>
                                <property name="fields">
                                    <map>
                                        <entry key="name" value="true"/>
                                        <entry key="population" value="false"/>
                                    </map>
                                </property>
                                <property name="indexType" value="SORTED"/>
                            </bean>
                        </list>
                    </property>
                </bean>
            </list>
        </property>
    </bean>
{code}


> Wrong type name in cache metadata on query execution
> ----------------------------------------------------
>
>                 Key: IGNITE-7960
>                 URL: https://issues.apache.org/jira/browse/IGNITE-7960
>             Project: Ignite
>          Issue Type: Bug
>          Components: cache, sql
>    Affects Versions: 2.5
>            Reporter: Vasiliy Sisko
>            Assignee: Vladimir Ozerov
>            Priority: Major
>         Attachments: Country.java, TestQuery.java, reproducer.zip
>
>
> 1) On run of demo mode in Web console in Queries page for every query showed 
> error. F.e.:
> Error: Table "CAR" not found.
> After debug I notice that org.h2.schema.Schema#tablesAndViews map contains 
> key with type name stored as "Car". In that case query parser require "CAR" 
> name and query fail.
> Caches created by invocation of java config 
> org.apache.ignite.Ignite#getOrCreateCaches
> 2) I create simple reproducer (See files TestQuery.java and Country.java), 
> but metadata and parser in that case use the same name "Car". 
> Caches created by invocation of java config 
> org.apache.ignite.Ignite#getOrCreateCaches
> Added reproducer. See [^reproducer.zip]. Run RunFirst.java, stop RunFirst. 
> run RunFirst.java again then run RunSecond.java. Second class try to execute 
> query and print error.
> 3) Configured in XML cache has normalised name of type "CAR". In that case 
> parser too require "CAR" name and work without error.
> Caches created in process of cluster activation.
> Base cache config:
> {code}
>     <bean id="tester_cache" abstract="true" 
> class="org.apache.ignite.configuration.CacheConfiguration">
>         <property name="statisticsEnabled" value="true"/>
>         <property name="queryDetailMetricsSize" value="10"/>
>         <property name="affinity">
>             <bean 
> class="org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction">
>                 <property name="partitions" value="10"/>
>             </bean>
>         </property>
>     </bean>
> {code}
> Partitioned cache config:
> {code}
>     <bean id="default_partitioned" abstract="true" parent="tester_cache">
>         <property name="name" value="DEFAULT"/>
>         <property name="cacheMode" value="PARTITIONED"/>
>         <property name="writeSynchronizationMode" value="PRIMARY_SYNC"/>
>         <property name="backups" value="1"/>
>         <property name="indexedTypes">
>             <list>
>                 <value>java.lang.Integer</value>
>                 <value>java.lang.String</value>
>             </list>
>         </property>
>         <property name="sqlFunctionClasses">
>             <list>
>                <value>org.ignite.sql.VisorTesterSQLFunctionsClass</value>
>                 <value>org.ignite.sql.VisorTesterSQLMathFunctionsClass</value>
>                 <value>org.ignite.sql.VisorTesterSQLStrFunctionsClass</value>
>             </list>
>         </property>
>     </bean>
> {code}
> Final cache config:
> {code}
>     <bean id="c_partitioned2" abstract="true" parent="default_partitioned">
>         <property name="name" value="c_partitioned2"/>
>         <property name="indexedTypes">
>             <list>
>                 <value>java.util.UUID</value>
>                 <value>org.ignite.sql.Car</value>
>             </list>
>         </property>
>         <property name="queryEntities">
>             <list>
>                 <bean class="org.apache.ignite.cache.QueryEntity">
>                     <property name="keyType" 
> value="org.ignite.sql.AddressKey"/>
>                     <property name="valueType" 
> value="org.ignite.sql.Address"/>
>                     <property name="keyFields">
>                         <list>
>                             <value>pk</value>
>                         </list>
>                     </property>
>                     <property name="fields">
>                         <map>
>                             <entry key="pk" value="java.lang.Integer"/>
>                             <entry key="street" value="java.lang.String"/>
>                             <entry key="zip" value="java.lang.Integer"/>
>                         </map>
>                     </property>
>                     <property name="indexes">
>                         <list>
>                             <bean class="org.apache.ignite.cache.QueryIndex">
>                                 <property name="name" value="ZIP_DESC_IDX"/>
>                                 <property name="fields">
>                                     <map>
>                                         <entry key="zip" value="false"/>
>                                     </map>
>                                 </property>
>                                 <property name="indexType" value="SORTED"/>
>                             </bean>
>                             <bean class="org.apache.ignite.cache.QueryIndex">
>                                 <property name="name" value="STREET_TXT_IDX"/>
>                                 <property name="fields">
>                                     <map>
>                                         <entry key="street" value="true"/>
>                                     </map>
>                                 </property>
>                                 <property name="indexType" value="FULLTEXT"/>
>                             </bean>
>                             <bean class="org.apache.ignite.cache.QueryIndex">
>                                 <property name="name" value="GRP_IDX"/>
>                                 <property name="fields">
>                                     <map>
>                                         <entry key="street" value="true"/>
>                                         <entry key="zip" value="true"/>
>                                     </map>
>                                 </property>
>                                 <property name="indexType" value="SORTED"/>
>                             </bean>
>                         </list>
>                     </property>
>                 </bean>
>                 <bean class="org.apache.ignite.cache.QueryEntity">
>                     <property name="keyType" 
> value="org.ignite.sql.CountryKey"/>
>                     <property name="valueType" 
> value="org.ignite.sql.CountryVal"/>
>                     <property name="keyFields">
>                         <list>
>                             <value>pk</value>
>                         </list>
>                     </property>
>                     <property name="fields">
>                         <map>
>                             <entry key="pk" value="java.lang.Integer"/>
>                             <entry key="name" value="java.lang.String"/>
>                             <entry key="population" 
> value="java.lang.Integer"/>
>                         </map>
>                     </property>
>                     <property name="indexes">
>                         <list>
>                             <bean class="org.apache.ignite.cache.QueryIndex">
>                                 <property name="name" 
> value="Country_name_ppl_IDX"/>
>                                 <property name="fields">
>                                     <map>
>                                         <entry key="name" value="true"/>
>                                         <entry key="population" 
> value="false"/>
>                                     </map>
>                                 </property>
>                                 <property name="indexType" value="SORTED"/>
>                             </bean>
>                         </list>
>                     </property>
>                 </bean>
>             </list>
>         </property>
>     </bean>
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to