https://questdb.io logo
Title
j

John

12/16/2022, 11:17 AM
Brand new user here, just playing around. I see that I can create tables with a specific structure.. however when I was playing with the python questdb.ingress I was using Sender() to send rows to a table which I had not yet created. Is the python questdb.ingress creating the table for me as it doesn't exist? And is it having a best effort guess at what data types to use for the symbols/columns? Is there a way I can be specific about the data types in the python sender.row()? Thanks šŸ™‚
with Sender(host, port) as sender:
sender.row(
'price_test',
symbols={'store': '12345',
'product': 'Widget',
'prod_type': 'Item Only'},
columns={
'price': '6.75'
},
)
n

Nicolas Hourcard

12/16/2022, 11:18 AM
welcome @John! team will be looking into this
j

John

12/16/2022, 11:21 AM
Thanks. Off topic: Listened to you on "The Craft Of Open Source" podcast from 4/5/2021 yesterday. šŸ‘
n

Nicolas Hourcard

12/16/2022, 11:22 AM
nice, good to hear ! how did you find about the podcast?
j

John

12/16/2022, 11:23 AM
I enjoyed it. Peaked my interest to have a play with questdb.
I've just answered my own question.. the table is being created utilising the type of the dictionary value afaik.
I changed
'price': '6.75'
to
'price': 6.75
at pointed it at a new table and it created that column as a double. Float probably would have been fine. I also tested the changed price code publishing to the original table but didn't get an error and the row didn't add. I thought that may have been caught by my:
except IngressError as e:
sys.stderr.write(f'Got error: {e}\n')
b

Bolek Ziobrowski

12/16/2022, 11:52 AM
@John. Python client sends data to ILP endpoint which creates the missing tables/columns by guessing the type. While you can influence it with the following settings : ā€¢ line.float.default.column.type ā€¢ line.integer.default.column.type ā€¢ line.default.partition.by It's often better to create table with exact types & settings in advance .
j

John

12/16/2022, 12:15 PM
Thanks @Bolek Ziobrowski. If I send a row via ILP (Sender()) endpoint that does not conform to the table created, should Sender() be raising an IngressError exception?
b

Bolek Ziobrowski

12/16/2022, 12:21 PM
The default behavior of ILP is to close connection on error . You should find error messages in qdb logs .
j

John

12/16/2022, 12:33 PM
Yep, I see it. Thank you @Bolek Ziobrowski