I have a database in Impala, and I need to use Kudu tables in it. I'd like to use SQLAlchemy in my Python code to interact with the database. Although Impala is not a supported dialect in SQLALchemy, I have been able to access data and do basic modifications in my existing Kudu and non-Kudu tables.
I've read this question and its answers and also the GitHub page linked there, but they are about connecting to an Impala db, which I managed to do.
(I have also considered using the Kudu Python Client instead of SQLAlchemy, but that doesn't work because my code will run on Ubuntu 18.04 and it is not supported.)
My question is specifically about the creation of Kudu tables using SQLAlchemy. When I use plain SQL, it looks like this:
CREATE TABLE my_table (
id INT,
message STRING,
PRIMARY KEY (id)
)
STORED AS KUDU
There are two things that indicate that this is a Kudu table: the presence of a primary key, which doesn't exist in Impala, and of course the last row.
Marking a column as primary key is not a problem in SQLAlchemy. But is there a way to include STORED AS KUDU
in a table creation call?