Skip to content

Conversation

rad-pat
Copy link
Contributor

@rad-pat rad-pat commented Mar 20, 2024

After experiencing a number of issues with the dialect, I incorporated the SQLAlchemy test suite and adapted the dialect to pass the tests. The previous unit and integration tests are basically redundant following this change, but I have updated them to pass but they do not work alongside the SQLAlchemy tests. To incorporate those, they just need to be turned into classes descending from SQLalchemy TestBase class, but the tests therein are easily covered by the test suite.

One problem noticed is that statements executed against the databend server record timeouts on the server. It's like the cursor.close() does nothing - that's probably a driver issue I assume - although the cursor close does nothing in the dialect here, but there is no driver method to call.

This will address issue #24 #25 #26

@rad-pat
Copy link
Contributor Author

rad-pat commented Mar 22, 2024

I'm working on fixing CI tests. This pipenv thing is ugly when you've not used it before.

@sundy-li
Copy link
Member

One problem noticed is that statements executed against the databend server record timeouts on the server. It's like the cursor.close() does nothing - that's probably a driver issue I assume - although the cursor close does nothing in the dialect here, but there is no driver method to call.

Yes, if we start a query to the server and do not poll the data, the server will mark the session as expired.

So I open an issue on #23. By default, we should disable stream_results so it'll finish the whole query inside a loop and cache the results in memory to iterator.

Comment on lines +200 to +212
# ToDo - get this working, failing because cannot substitute bytes parameter into sql statement
# CREATE TABLE binary_test (x binary not null)
# INSERT INTO binary_test (x) values (b'7\xe7\x9f') ???
# It is possible to do this
# INSERT INTO binary_test (x) values (TO_BINARY('7\xe7\x9f'))
# but that's not really a solution I don't think
@testing.skip("databend")
def test_binary_roundtrip(self):
pass

@testing.skip("databend")
def test_pickle_roundtrip(self):
pass
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hantmac Maybe you have a suggestion how I may get these binary tests working? Currently it is not possible to insert binary data using the dialect.

Copy link
Member

Choose a reason for hiding this comment

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

@rad-pat Hi, the bitmap data type in Databend is a binary type that differs from other supported types in terms of its representation and display in SELECT statements. So you can use this doc

Copy link
Member

@hantmac hantmac left a comment

Choose a reason for hiding this comment

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

/LGTM 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants