From the course: Apache Flink: Exploratory Data Analytics with SQL

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Writing tables to files

Writing tables to files - SQL Tutorial

From the course: Apache Flink: Exploratory Data Analytics with SQL

Start my 1-month free trial

Writing tables to files

- [Instructor] In this video, we will write the filtered output table created in the previous video to csv file. In order to write to a file, we first need to create a table sync. In this case, we create a table sync that can create a raw object and write to a file. The sync is created using the csv table sync class. Additional sync implementations are available for other types of data stores like JDBC. We create the csv table sync with the path to the destination file. In this case, we write to MouseSales.csv. We specify the field delimiter for the file. We mentioned the number of files to create which in this case is one. We also set the right mode to overwrite so every time the code runs, it overrides the entire file if it already exists. Next, we use the configured function to specify a Schema for the file. The specific column names and the data types are specified. They should match the schema of the table…

Contents