Skip to content

Conversation

@costin
Copy link
Member

@costin costin commented Mar 15, 2019

For cases where fields can have multi values, allow the behavior to be
customized through a dedicated configuration field.
By default this will be enabled on the drivers so that existing datasets
work instead of throwing an exception.
For regular SQL usage, the behavior is false so that the user is aware
of the underlying data.

Fix #39700

For cases where fields can have multi values, allow the behavior to be
customized through a dedicated configuration field.
By default this will be enabled on the drivers so that existing datasets
work instead of throwing an exception.
For regular SQL usage, the behavior is false so that the user is aware
of the underlying data.

Fix elastic#39700
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

super(query, params, filter, zoneId, fetchSize, requestTimeout, pageTimeout, requestInfo);
this.cursor = cursor;
this.columnar = columnar;
this.fieldmultiValueLeniency = multiValueFieldLeniency;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the different naming style between the constructor parameter and the inner variable? fieldmultiValueLeniency VS. multiValueFieldLeniency. Also, if you want to stick with this difference, it should be fieldMultiValueLeniency (capital letter M).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename leftover.

Copy link
Contributor

@matriv matriv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Left a comment.


[float]
==== Mapping
`field.multi.value.leniency` (default `true`):: Whether to lenient and return the first value for fields with multiple values (true) or throw an exception.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whether to be lenient...

Copy link
Contributor

@astefan astefan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Left few minor comments.
Also, should we add an update to the Limitations page? https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-limitations.html#_array_type_of_fields


[float]
==== Mapping
`field.multi.value.leniency` (default `true`):: Whether to lenient and return the first value for fields with multiple values (true) or throw an exception.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Whether to be lenient and return....."

}

private void createTestDataForByteValueTests(byte random1, byte random2, byte random3) throws Exception, IOException {
private void createRandomMultiValue() throws Exception {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use a different name for this method, more in-line with the rest of the methods: createTestDataForMultiValueTests.

Boolean.FALSE,
null,
new RequestInfo(Mode.CLI),
false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of false value for multi_value_leniency here why not using Protocol.FIELD_MULTI_VALUE_LENIENCY ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, this means that on the CLI we won't allow users to use the multi-value leniency option... I think it makes sense.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed we won't since that's a human consumer that needs to be made aware of it.

null,
null,
requestInfo(),
false).toXContent(builder, params);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of false value for multi_value_leniency here why not using Protocol.FIELD_MULTI_VALUE_LENIENCY ?

// trigger version initialization
// typically this should have already happened but in case the
// JdbcDriver/JdbcDataSource are not used and the impl. classes used directly
// Esriver/EsDataSource are not used and the impl. classes used directly
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EsDriver/EsDataSource

@costin
Copy link
Member Author

costin commented Mar 18, 2019

@astefan
Copy link
Contributor

astefan commented Mar 18, 2019

Yep, sorry about that. For whatever unknown reason, I didn't fully connect the dots.

@costin costin merged commit 2b35157 into elastic:master Mar 18, 2019
@costin costin deleted the fix-39700 branch March 18, 2019 12:56
costin added a commit that referenced this pull request Mar 18, 2019
For cases where fields can have multi values, allow the behavior to be
customized through a dedicated configuration field.
By default this will be enabled on the drivers so that existing datasets
work instead of throwing an exception.
For regular SQL usage, the behavior is false so that the user is aware
of the underlying data.

Fix #39700

(cherry picked from commit 2b35157)
costin added a commit that referenced this pull request Mar 18, 2019
For cases where fields can have multi values, allow the behavior to be
customized through a dedicated configuration field.
By default this will be enabled on the drivers so that existing datasets
work instead of throwing an exception.
For regular SQL usage, the behavior is false so that the user is aware
of the underlying data.

Fix #39700

(cherry picked from commit 2b35157)
costin added a commit that referenced this pull request Mar 18, 2019
For cases where fields can have multi values, allow the behavior to be
customized through a dedicated configuration field.
By default this will be enabled on the drivers so that existing datasets
work instead of throwing an exception.
For regular SQL usage, the behavior is false so that the user is aware
of the underlying data.

Fix #39700

(cherry picked from commit 2b35157)
@jakelandis jakelandis removed the v8.0.0 label Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SQL: array columns for drivers

6 participants