Skip to content
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

ARROW-15112: [Integration][C++][Java] Implement Flight SQL integration tests #11989

Conversation

rafael-telles
Copy link
Contributor

@rafael-telles rafael-telles commented Dec 17, 2021

This adds Flight SQL scenarios for integration tests for C++ and Java implementations.
The integrations tests assert that:

  • RPC objects built on clients are parsed correctly on servers
  • Arrow vectors built on servers have the expected Arrow schemas when received on clients

Note: Had to separate integration tests in a new module within Java and C++ to avoid circular dependencies (Flight <-> Flight SQL)

While working on this I found some inconsistencies between both implementation, this PR also fixes these problems.

@github-actions
Copy link

@rafael-telles
Copy link
Contributor Author

Hi @lidavidm ! We wrote the integration tests for Flight SQL as requested :)

Copy link
Member

@lidavidm lidavidm left a comment

Choose a reason for hiding this comment

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

Thanks for the quick turnaround, this looks good overall. I left some comments.

# specific language governing permissions and limitations
# under the License.

add_custom_target(arrow_flight_integration_tests)
Copy link
Member

Choose a reason for hiding this comment

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

Is the target necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was already there on arrow/flight/CMakeLists.txt before moving to the new directory

cpp/src/arrow/CMakeLists.txt Outdated Show resolved Hide resolved
cpp/src/arrow/flight/integration_tests/test_integration.cc Outdated Show resolved Hide resolved
cpp/src/arrow/flight/integration_tests/test_integration.cc Outdated Show resolved Hide resolved
@lidavidm
Copy link
Member

We need to exclude Go and Rust from the new test scenario.

Also, the PR needs to be formatted (see https://arrow.apache.org/docs/developers/cpp/development.html#code-style-linting-and-ci, note that we use ClangTools 12 now not version 8)

@rafael-telles
Copy link
Contributor Author

Done @lidavidm

@rafael-telles
Copy link
Contributor Author

Hey @lidavidm , I don't know if these CI failures has something to do with these changes... Please let me know if there is anything else to do here

@lidavidm
Copy link
Member

There's some lint failures:


[1/1] cd /tmp/arrow-lint-6fb2hzaq/cpp-build && /usr/local/bin/python /arrow/cpp/build-support/lint_cpp_cli.py /arrow/cpp/src
INFO:archery:Running Python formatter (autopep8)
INFO:archery:Running Python linter (flake8)
/arrow/dev/archery/archery/integration/tester_java.py:52:80: E501 line too long (95 > 79 characters)
/arrow/dev/archery/archery/integration/runner.py:387:80: E501 line too long (82 > 79 characters)
INFO:archery:Running cmake-format linters
ERROR __main__.py:618: Check failed: /arrow/cpp/src/arrow/CMakeLists.txt

I think the other one is unrelated, but could you rebase on master to see if it goes away?

@rafael-telles
Copy link
Contributor Author

Ops @lidavidm ... Sorry, I don't know if I messed up when git rebase master or if also need to run it in the base branch flight-sql...

@lidavidm
Copy link
Member

Ah, right, we have a branch…How about I rebase the branch, and then we can rebase the PRs?

@lidavidm
Copy link
Member

Hmm. I just rebased the branch…so do you mind trying to rebase again here? Sorry for the trouble.

@rafael-telles rafael-telles force-pushed the flight-sql-integration-tests-2 branch from 78352e9 to 97fe3ce Compare December 20, 2021 23:12
@rafael-telles
Copy link
Contributor Author

No problem! Just rebased :)

@lidavidm
Copy link
Member

Well, looks like the Docker registry isn't doing so well right now. I'll kick all the CI pipelines in a bit to try again.

@lidavidm
Copy link
Member

Hmm, I wonder if the test failure in Dev is just because it's getting confused since we're on a branch. I think we can resolve that when we make the final PR from flight-sql into master, then.

Copy link
Member

@lidavidm lidavidm left a comment

Choose a reason for hiding this comment

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

Thanks, just one more nit that caught my eye.

sqlClient.execute("SELECT STATEMENT", options), sqlClient);

IntegrationAssertions.assertEquals(sqlClient.executeUpdate("UPDATE STATEMENT", options),
10000L);
Copy link
Member

Choose a reason for hiding this comment

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

Just a nit, but can we move these numbers to constants so it's clear what they represent? (UPDATE_STATEMENT_EXPECTED_ROWS or something)

Copy link
Member

Choose a reason for hiding this comment

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

(The same goes for the producer, C++, etc.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! Done

@rafael-telles
Copy link
Contributor Author

Hey @lidavidm ! Are we good to merge this on flight-sql branch and then on master?

Thank you

@lidavidm
Copy link
Member

We should be. I just kicked off CI.

@lidavidm
Copy link
Member

I think the failures are spurious. (I filed ARROW-15181 for the crash in the Flight tests.)

Copy link
Member

@lidavidm lidavidm left a comment

Choose a reason for hiding this comment

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

Thanks. Sorry, I just noticed a couple more small things - we can merge into the branch next.

@rafael-telles
Copy link
Contributor Author

Glad to see everything passing! Except to that "Dev/ Source Release and Merge Script", but it indeed seem to fail because we are in our own branch

lidavidm pushed a commit that referenced this pull request Dec 21, 2021
…n tests

This adds Flight SQL scenarios for integration tests for C++ and Java implementations.
The integrations tests assert that:
- RPC objects built on clients are parsed correctly on servers
- Arrow vectors built on servers have the expected Arrow schemas when received on clients

Note: Had to separate integration tests in a new module within Java and C++ to avoid circular dependencies (Flight <-> Flight SQL)

While working on this I found some inconsistencies between both implementation, this PR also fixes these problems.

Closes #11989 from rafael-telles/flight-sql-integration-tests-2

Authored-by: Rafael Telles <rafael@telles.dev>
Signed-off-by: David Li <li.davidm96@gmail.com>
@lidavidm
Copy link
Member

Mega-PR is up at #12013

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.

2 participants