Apache Flink Tutorial
Selected Reading
- Apache Flink - Discussion
- Apache Flink - Useful Resources
- Apache Flink - Quick Guide
- Apache Flink - Conclusion
- Apache Flink - Flink vs Spark vs Hadoop
- Apache Flink - Use Cases
- Apache Flink - Machine Learning
- Apache Flink - Libraries
- Apache Flink - Running a Flink Program
- Creating a Flink Application
- Apache Flink - Table API and SQL
- Apache Flink - API Concepts
- Apache Flink - Setup/Installation
- Apache Flink - System Requirements
- Apache Flink - Architecture
- Apache Flink - Introduction
- Batch vs Real-time Processing
- Apache Flink - Big Data Platform
- Apache Flink - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Apache Flink - Table API and SQL
Apache Fpnk - Table API and SQL
Table API is a relational API with SQL pke expression language. This API can do both batch and stream processing. It can be embedded with Java and Scala Dataset and Datastream APIs. You can create tables from existing Datasets and Datastreams or from external data sources. Through this relational API, you can perform operations pke join, aggregate, select and filter. Whether the input is batch or stream, the semantics of the query remains the same.
Here is a sample Table API program −
// for batch programs use ExecutionEnvironment instead of StreamExecutionEnvironment val env = StreamExecutionEnvironment.getExecutionEnvironment // create a TableEnvironment val tableEnv = TableEnvironment.getTableEnvironment(env) // register a Table tableEnv.registerTable("table1", ...) // or tableEnv.registerTableSource("table2", ...) // or tableEnv.registerExternalCatalog("extCat", ...) // register an output Table tableEnv.registerTableSink("outputTable", ...); // create a Table from a Table API query val tapiResult = tableEnv.scan("table1").select(...) // Create a Table from a SQL query val sqlResult = tableEnv.sqlQuery("SELECT ... FROM table2 ...") // emit a Table API result Table to a TableSink, same for SQL result tapiResult.insertInto("outputTable") // execute env.execute()Advertisements