Skip to content

Instantly share code, notes, and snippets.

@confluentgist
Last active March 15, 2019 23:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save confluentgist/fec77a553824119bfef29119c62826e8 to your computer and use it in GitHub Desktop.
Save confluentgist/fec77a553824119bfef29119c62826e8 to your computer and use it in GitHub Desktop.
Connect to KSQL and CREATE TABLE Using Python
from ksql import KSQLAPI
client = KSQLAPI('http://localhost:8088')
client.create_stream(table_name='creditcardfraud_source',
columns_type=['Id bigint', 'Timestamp varchar', 'User varchar', 'Time int', 'V1 double', 'V2 double', 'V3 double', 'V4 double', 'V5 double', 'V6 double', 'V7 double', 'V8 double', 'V9 double', 'V10 double', 'V11 double', 'V12 double', 'V13 double', 'V14 double', 'V15 double', 'V16 double', 'V17 double', 'V18 double', 'V19 double', 'V20 double', 'V21 double', 'V22 double', 'V23 double', 'V24 double', 'V25 double', 'V26 double', 'V27 double', 'V28 double', 'Amount double', 'Class string'],
topic='creditcardfraud_source',
value_format='DELIMITED')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment