[ 
https://issues.apache.org/jira/browse/DRILL-6216?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16390069#comment-16390069
 ] 

Sorabh Hamirwasia commented on DRILL-6216:
------------------------------------------

Hi All,

The root cause for DRILL-6216 is due to a recent change made as part 
of[https://urldefense.proofpoint.com/v2/url?u=https-3A__issues.apache.org_jira_browse_DRILL-2D6049&d=DwIFAw&c=cskdkSMqhcnjZxdQVpwTXg&r=gRpEl0WzXE3EMrwj0KFbZXGXRyadOthF2jlYxvhTlQg&m=YvCUBRsPY3EVX3oqGKDhUhKNuvrmpt37EuaRNYLIxlE&s=oeEFw22PxBEEd6WyfpzeD5v-oi_PsD2SaoR1SDO-RKw&e=].
 With this PR a default field name for values ValueVector inside any 
NullableValueVector was introduced which is $values$ [1]. Before this PR the 
values ValueVector field name was same as the field name of actual 
NullableValueVector holding it [2]. In the load method of certain ValueVectors 
like BigIntVector there is an equality check for the ValueVector field name and 
metadata.name_part name [3].

In setup where Drillbit and DrillClient are running in different version 
(between 1.12 and 1.13) the equality check in load method will fail. For 
example: When server is running 1.13 and client is on 1.12, in that case the 
record batch from server side will come with NullableValueVector (NV1 with 
field name as num_val) but with it's values ValueVector field name as $values$. 
When on client side corresponding NullableValueVector (NV2) is created it will 
use the actual field name (num_val) for values ValueVector. After calling load 
on received NullableValueVector NV2 with metadata information from server that 
internally alls load on values ValueVector and the check fails since ($values$ 
!= num_val).


Since the change is in template of ValueVector, to fix this issue both client 
and server needs to identify their respective version on which they are running 
and choose the field name for values ValueVector correspondingly. Given 
DRILL-6049 touches huge sets of files I am also not sure what are the other 
impacts with it. It would be great to discuss on how we should proceed with 
this issue before making any further change.


[1]: 
[https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_apache_drill_blob_master_exec_vector_src_main_java_org_apache_drill_exec_vector_ValueVector.java-23L92&d=DwIFAw&c=cskdkSMqhcnjZxdQVpwTXg&r=gRpEl0WzXE3EMrwj0KFbZXGXRyadOthF2jlYxvhTlQg&m=YvCUBRsPY3EVX3oqGKDhUhKNuvrmpt37EuaRNYLIxlE&s=gjEcDbuGniihjh_1RdQEpGJ9eboKsgPPTJkH8_OCytU&e=]

[https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_apache_drill_blob_master_exec_vector_src_main_codegen_templates_NullableValueVectors.java-23L82&d=DwIFAw&c=cskdkSMqhcnjZxdQVpwTXg&r=gRpEl0WzXE3EMrwj0KFbZXGXRyadOthF2jlYxvhTlQg&m=YvCUBRsPY3EVX3oqGKDhUhKNuvrmpt37EuaRNYLIxlE&s=miSD59RRvY6njdKTyLSf5q8U4S51NcxY3IulJGonSxw&e=]

[2]:https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_apache_drill_blob_1.12.0_exec_vector_src_main_codegen_templates_NullableValueVectors.java-23L70&d=DwIFAw&c=cskdkSMqhcnjZxdQVpwTXg&r=gRpEl0WzXE3EMrwj0KFbZXGXRyadOthF2jlYxvhTlQg&m=YvCUBRsPY3EVX3oqGKDhUhKNuvrmpt37EuaRNYLIxlE&s=3VokpAZoZGSvcdfIU23QuigGGKHPPupiCcLpxDxeP84&e=

[3]: 
[https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_apache_drill_blob_1.12.0_exec_vector_src_main_codegen_templates_FixedValueVectors.java-23L238&d=DwIFAw&c=cskdkSMqhcnjZxdQVpwTXg&r=gRpEl0WzXE3EMrwj0KFbZXGXRyadOthF2jlYxvhTlQg&m=YvCUBRsPY3EVX3oqGKDhUhKNuvrmpt37EuaRNYLIxlE&s=-UDZrABPkMkRiAURufI-oT2AepfOHC9d5v-OXH64sHo&e=]

> Metadata mismatch when connecting to a Drill 1.12.0 with a 
> Drill-1.13.0-SNAPSHOT driver
> ---------------------------------------------------------------------------------------
>
>                 Key: DRILL-6216
>                 URL: https://issues.apache.org/jira/browse/DRILL-6216
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Client - JDBC
>    Affects Versions: 1.13.0
>            Reporter: Kunal Khatua
>            Assignee: Sorabh Hamirwasia
>            Priority: Blocker
>             Fix For: 1.13.0
>
>
> When running against a 1.12.0 Drill server
> {code:sql}
>  select * from sys.`options`;
> {code}
> I hit the following issue in Squirrel-SQL client with the 1.13.0-SNAPSHOT 
> JDBC driver.
> {code:java}
> 2018-02-20 11:41:16,557 [Thread-2] DEBUG 
> net.sourceforge.squirrel_sql.fw.util.DefaultExceptionFormatter  - Error
> java.sql.SQLException: Unexpected RuntimeException: 
> java.lang.IllegalArgumentException: The field [`$values$` (BIGINT:OPTIONAL)] 
> doesn't match the provided metadata major_type {
>   minor_type: BIGINT
>   mode: OPTIONAL
> }
> name_part {
>   name: "num_val"
> }
> value_count: 153
> buffer_length: 1224
> .
>       at 
> org.apache.drill.jdbc.impl.DrillCursor.nextRowInternally(DrillCursor.java:544)
>       at 
> org.apache.drill.jdbc.impl.DrillCursor.loadInitialSchema(DrillCursor.java:602)
>       at 
> org.apache.drill.jdbc.impl.DrillResultSetImpl.execute(DrillResultSetImpl.java:1918)
>       at 
> org.apache.drill.jdbc.impl.DrillResultSetImpl.execute(DrillResultSetImpl.java:66)
>       at 
> oadd.org.apache.calcite.avatica.AvaticaConnection$1.execute(AvaticaConnection.java:630)
>       at 
> org.apache.drill.jdbc.impl.DrillMetaImpl.prepareAndExecute(DrillMetaImpl.java:1106)
>       at 
> org.apache.drill.jdbc.impl.DrillMetaImpl.prepareAndExecute(DrillMetaImpl.java:1117)
>       at 
> oadd.org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:638)
>       at 
> org.apache.drill.jdbc.impl.DrillConnectionImpl.prepareAndExecuteInternal(DrillConnectionImpl.java:193)
>       at 
> oadd.org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:149)
>       at 
> oadd.org.apache.calcite.avatica.AvaticaStatement.execute(AvaticaStatement.java:209)
>       at 
> org.apache.drill.jdbc.impl.DrillStatementImpl.execute(DrillStatementImpl.java:101)
>       at 
> net.sourceforge.squirrel_sql.client.session.StatementWrapper.execute(StatementWrapper.java:165)
>       at 
> net.sourceforge.squirrel_sql.client.session.SQLExecuterTask.processQuery(SQLExecuterTask.java:378)
>       at 
> net.sourceforge.squirrel_sql.client.session.SQLExecuterTask.run(SQLExecuterTask.java:221)
>       at 
> net.sourceforge.squirrel_sql.fw.util.TaskExecuter.run(TaskExecuter.java:82)
>       at java.lang.Thread.run(Unknown Source)
> Caused by: java.lang.IllegalArgumentException: The field [`$values$` 
> (BIGINT:OPTIONAL)] doesn't match the provided metadata major_type {
>   minor_type: BIGINT
>   mode: OPTIONAL
> }
> name_part {
>   name: "num_val"
> }
> value_count: 153
> buffer_length: 1224
> .
>       at 
> oadd.com.google.common.base.Preconditions.checkArgument(Preconditions.java:145)
>       at 
> oadd.org.apache.drill.exec.vector.BigIntVector.load(BigIntVector.java:299)
>       at 
> oadd.org.apache.drill.exec.vector.NullableBigIntVector.load(NullableBigIntVector.java:295)
>       at 
> oadd.org.apache.drill.exec.record.RecordBatchLoader.load(RecordBatchLoader.java:135)
>       at 
> org.apache.drill.jdbc.impl.DrillCursor.nextRowInternally(DrillCursor.java:506)
>       ... 16 more
> {code}
> This issue however, doesn't exist when working with Apache Master 
> 1.13.0-SNAPSHOT



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

Reply via email to