Skip to main content

Data import / export cheat sheet

CSV#

from deephaven.TableTools import readCsv, readHeaderlessCsv, writeCsv
result = readCsv("/data/inputFile.csv", format)result = readHeaderlessCsv("/data/inputFile.csv", columnNames...)writeCsv(table, "/data/outputFile.csv")

Parquet#

from deephaven import ParquetTools as pt
result = pt.readTable("/data/inputFile.parquet")result = pt.readTable("/data/inputDirectory")pt.writeTable(source, "/data/output.parquet") # source as any table in Deephaven

Kafka#

from deephaven import KafkaTools as kt
result = kt.consumeToTable(kafkaConsumerProperties, topic) # formatresult = kt.consumeToTable({'bootstrap.servers': 'redpanda:29092'}, 'testTopic') # usage