Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Comparison test framework improvement #339

Closed
dai-chen opened this issue Jan 9, 2020 · 2 comments
Closed

Comparison test framework improvement #339

dai-chen opened this issue Jan 9, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@dai-chen
Copy link
Member

dai-chen commented Jan 9, 2020

Creating this issue for followup work on test framework. Will add more to-do items if needed.

1.In our JDBC implementation, getColumnName() returns column original name in SELECT and getColumnLabel returns its alias. But other reference database seems return alias directly from getColumnName().

2.Just found that org.json seems not respect column order in LinkedHashMap. Needs to convert it to list manually.

3.After fixing bugs in our JDBC driver, we need to add dependency for latest artifact in Gradle. One option is to use local path: testCompile files('libs/opendistro-sql-jdbc-1.4.0.0-SNAPSHOT.jar') in build.gradle. In this case, our GitHub Action should check out and build JDBC master branch whenever it runs comparison test.

4.The current test framework passes Java LinkedHashMap and HashSet for schema and data rows in DBResult class. HashMap and ArrayList needs to be used instead for the case of schema in SELECT * and data rows in ORDER BY.

@dai-chen dai-chen added bug Something isn't working enhancement New feature or request labels Jan 9, 2020
@dai-chen dai-chen self-assigned this Jan 9, 2020
@dai-chen dai-chen added this to the 1/2020-Release milestone Jan 9, 2020
@dai-chen
Copy link
Member Author

The first 2 issue fixes have been merged. Need to figure out how to handle the 3rd issue especially.

@dai-chen
Copy link
Member Author

5.Need minor changes to support MySQL database.

The follow issue may be caused by length of VARCHAR is required in MySQL.

  2> java.lang.IllegalStateException: Failed to create table [kibana_sample_data_flights]
        at __randomizedtesting.SeedInfo.seed([10BD31FCB60C0A4A:F613C15757C860A7]:0)
        at com.amazon.opendistroforelasticsearch.sql.correctness.runner.connection.JDBCConnection.create(JDBCConnection.java:76)
        at com.amazon.opendistroforelasticsearch.sql.correctness.runner.ComparisonTest.loadData(ComparisonTest.java:74)
        at com.amazon.opendistroforelasticsearch.sql.correctness.CorrectnessIT.performComparisonTest(CorrectnessIT.java:60)

        Caused by:
        java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ',Origin VARCHAR,FlightDelay boolean,DistanceMiles float,FlightTimeMin float,Orig' at line 1
            at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
            at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
            at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
            at com.mysql.cj.jdbc.StatementImpl.executeUpdateInternal(StatementImpl.java:1335)
            at com.mysql.cj.jdbc.StatementImpl.executeLargeUpdate(StatementImpl.java:2108)
            at com.mysql.cj.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1245)
            at com.amazon.opendistroforelasticsearch.sql.correctness.runner.connection.JDBCConnection.create(JDBCConnection.java:74)
            ... 2 more

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant