-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate Elasticsearch tests to use BaseConnectorTest #7109
Comments
I am pretty interested in this issuse, I want to deal with it. Could you give me a chance to solve this problem? |
Sure. I assigned you. Thanks @ToumaKazusa-san |
I've started to work on this one seeing that it's been a month since it was assigned. |
Sure. Thanks @findinpath @ToumaKazusa-san are you still working on this one? |
@losipiuk any idea how to tackle the test
but Elasticsearch delivers the table column metadata ordered by name alphabetically
which makes the test to fail. I've also tried creating the index explicitly by specifying the columns in the same order as they are delivered from the tpch The test obviously fails because the Elasticsearch columns are ordered alphabetically. |
Just provide an override for
Can you clarify? I do not see a reason why different column ordering should fail this test. |
The call
will fail, because in the translation of the resultset from H2 it will rely on the list of types retrieved from Elasticsearch (which is alphabetical) and therefore the conversion of the values from the result set will throw a conversion exception. |
I see. Please override this test for now. And please put explanatory comment in overridden test method. |
I've stumbled on a different problem while working on
Some of the double value for Note that after the casting to BIGINT we get the value Any ideas on this one? This is not related to Elasticsearch, but rather to Jdbi & H2 |
It look weird. Note that we are aggregating on Is the problem you are describing reproducable on your working branch already? I would like to play with that. |
Yes. I've pushed the code already.
Also have a look on slack
https://trinodb.slack.com/archives/CP1MUNEUX/p1618435906295800?thread_ts=1618435906.295800&cid=CP1MUNEUX
I think the problem exists since a longer time and is related to H2 rather
to Elastic
…On Thu, 15 Apr 2021, 14:24 Łukasz Osipiuk, ***@***.***> wrote:
I've stumbled on a different problem while working on
io.trino.testing.AbstractTestQueries#testLimitWithAggregation
MaterializedResult actual = computeActual("SELECT custkey, SUM(CAST(totalprice * 100 AS BIGINT)) FROM orders GROUP BY custkey LIMIT 10");
MaterializedResult all = computeExpected("SELECT custkey, SUM(CAST(totalprice * 100 AS BIGINT)) FROM orders GROUP BY custkey", actual.getTypes());
Some of the double value for totalprice in the orders H2 table while
being casted to BIGINT get rounded.
See the image below:
[image: image]
<https://user-images.githubusercontent.com/57260417/114779628-a4b59f00-9d76-11eb-8d68-59add875a8f5.png>
Note that after the casting to BIGINT we get the value 32000489 instead
of 32000488.
I've tried to reproduce the problem locally with a small jdbi & H2 memory
db test , but somehow there is no rounding happening.
Any ideas on this one? This is not related to Elasticsearch, but rather to
Jdbi & H2
It look weird. Note that we are aggregating on totalPrice * 100. So there
should not be any fractional part.
But maybe there still is something if Elastic maps totalPrice to double.
I most other databases we would map it to DECIMAL(..,2) and rounding
errors are not a problem there.
Is the problem you are describing reproducable on your working branch
already? I would like to play with that.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#7109 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANU3TAPB6QPLY4LG7HO5N5TTI3LG5ANCNFSM4YO2QLXQ>
.
|
Thanks I will take a look how to work around that.
Agreed. Just for connectors which use DECIMAL instead of DOUBLE it does not manifest in tests. |
The tests:
are also failing. Here is the relevant failed assertion:
I've looked over @martint you've modified the |
@losipiuk regarding the test
This issue can be fixed by overriding the value of the setting I see two options here:
I tend to go for the customized |
Two thoughts:
|
This is fine :) |
Regarding io.trino.testing.AbstractTestQueries#testLimitWithAggregation see #7610 |
Maybe just override test method with one using ES specific assertion. Looking for
for |
Summary of changes: - Rename BaseElasticsearchSmokeTest.java has been renamed to BaseElasticsearchConnectorTest.java - Rename TestElasticsearch6IntegrationSmokeTest.java to TestElasticsearch6ConnectorTest.java - Rename TestElasticsearch7IntegrationSmokeTest.java to TestElasticsearch7ConnectorTest.java - Add to the class BaseTestElasticsearchConnectorTest overrides for several generic tests in order to make them specific for Elasticsearch connector Resolves: trinodb#7109
#6989 introduced new
BaseConnectorTest
test class which replacesAbstractTestDistributedQueries
andAbstractTestIntegrationSmokeTest
.Scope of this ticket is to restructure Elasticsearch test code to follow new pattern.
BaseElasticsearchSmokeTest
should be renamed toBaseTestElasticsearchConnectorTest
and extendBaseConnectorTest
instead ofAbstractTestIntegrationSmokeTest
TestElasticsearch6IntegrationSmokeTest
should be renamed toTestElasticsearch6ConnectorTest
.TestElasticsearch7IntegrationSmokeTest
should be renamed toTestElasticsearch7ConnectorTest
.A PR which restructures MySQL tests is a good reference: #7011
The text was updated successfully, but these errors were encountered: