Easy SQL
stable
  • Easy SQL
  • Build and install Easy SQL
  • Quick start
  • Syntax
  • Debug ETL
  • Test ETL
  • Linter
  • Functions
  • UDFs
  • Variables
  • Flink backend
  • API Reference
    • ingest_funcs
    • ingest_hudi_funcs
    • easy_sql
      • Subpackages
        • easy_sql.cli
        • easy_sql.sql_linter
        • easy_sql.sql_processor
        • easy_sql.udf
        • easy_sql.utils
      • Submodules
    • sql_config
Easy SQL
  • »
  • API Reference »
  • easy_sql »
  • easy_sql.sql_processor »
  • easy_sql.sql_processor.backend »
  • easy_sql.sql_processor.backend.flink
  • Edit on GitHub

easy_sql.sql_processor.backend.flink

Module Contents

Classes

FlinkBackend

FlinkRow

FlinkTable

FlinkTablesConfig

class easy_sql.sql_processor.backend.flink.FlinkBackend(is_batch=True, flink_tables_config=None)

Bases: easy_sql.sql_processor.backend.base.Backend

digraph inheritance28b2efb11f { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "Backend" [URL="../base/index.html#easy_sql.sql_processor.backend.base.Backend",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "FlinkBackend" [URL="#easy_sql.sql_processor.backend.flink.FlinkBackend",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "Backend" -> "FlinkBackend" [arrowsize=0.5,style="setlinewidth(0.5)"]; }
Parameters
  • is_batch (Optional[bool]) –

  • flink_tables_config (Optional[FlinkTablesConfig]) –

add_jars(self, jars_path)
Parameters

jars_path (List[str]) –

clean(self)
create_cache_table(self, table, name)
Parameters
  • table (easy_sql.sql_processor.backend.base.Table) –

  • name (str) –

create_empty_table(self)
create_temp_table(self, table, name)
Parameters
  • table (easy_sql.sql_processor.backend.base.Table) –

  • name (str) –

exec_native_sql(self, sql)
Parameters

sql (str) –

Return type

pyflink.table.TableResult

exec_native_sql_query(self, sql)
Parameters

sql (str) –

Return type

pyflink.table.Table

exec_sql(self, sql)
Parameters

sql (str) –

Return type

easy_sql.sql_processor.backend.base.Table

execute_streaming_inserts(self)
init_udfs(self, scala_udf_initializer=None, *args, **kwargs)
Parameters

scala_udf_initializer (Optional[str]) –

refresh_table_partitions(self, table)
Parameters

table (easy_sql.sql_processor.backend.base.TableMeta) –

register_tables(self)
register_udfs(self, funcs)
Parameters

funcs (Dict[str, Callable]) –

save_table(self, source_table_meta, target_table_meta, save_mode, create_target_table=False)
Parameters
  • source_table_meta (easy_sql.sql_processor.backend.base.TableMeta) –

  • target_table_meta (easy_sql.sql_processor.backend.base.TableMeta) –

  • save_mode (easy_sql.sql_processor.backend.base.SaveMode) –

  • create_target_table (bool) –

save_table_sql(self, source_table, source_table_sql, target_table)
Parameters
  • source_table (easy_sql.sql_processor.backend.base.TableMeta) –

  • source_table_sql (str) –

  • target_table (easy_sql.sql_processor.backend.base.TableMeta) –

Return type

str

set_configurations(self, configs)
Parameters

configs (dict) –

table_exists(self, table)
Parameters

table (easy_sql.sql_processor.backend.base.TableMeta) –

class easy_sql.sql_processor.backend.flink.FlinkRow(row=None, fields=None)

Bases: easy_sql.sql_processor.backend.base.Row

digraph inheritanceff340c7461 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "FlinkRow" [URL="#easy_sql.sql_processor.backend.flink.FlinkRow",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "Row" -> "FlinkRow" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Row" [URL="../base/index.html#easy_sql.sql_processor.backend.base.Row",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; }
Parameters

fields (Optional[List[str]]) –

as_dict(self)
as_tuple(self)
Return type

Tuple

class easy_sql.sql_processor.backend.flink.FlinkTable(table)

Bases: easy_sql.sql_processor.backend.base.Table

digraph inheritance271046706e { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "FlinkTable" [URL="#easy_sql.sql_processor.backend.flink.FlinkTable",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "Table" -> "FlinkTable" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Table" [URL="../base/index.html#easy_sql.sql_processor.backend.base.Table",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; }
collect(self)
Return type

List[easy_sql.sql_processor.backend.base.Row]

count(self)
Return type

int

field_names(self)
Return type

List[str]

first(self)
Return type

easy_sql.sql_processor.backend.base.Row

is_empty(self)
Return type

bool

limit(self, count)
Parameters

count (int) –

Return type

FlinkTable

show(self, count=20)
Parameters

count (int) –

with_column(self, name, value)
Parameters
  • name (str) –

  • value (Any) –

Return type

FlinkTable

class easy_sql.sql_processor.backend.flink.FlinkTablesConfig
class Catalog
databases :Dict[str, FlinkTablesConfig]
options :str
temporary_tables :Dict[str, FlinkTablesConfig]
static from_dict(data)
Parameters

data (dict) –

Return type

FlinkTablesConfig

class Connector
options :str
static from_dict(data)
Parameters

data (dict) –

Return type

FlinkTablesConfig

class Database
tables :Dict[str, FlinkTablesConfig]
static from_dict(data)
Parameters

data (dict) –

Return type

FlinkTablesConfig

class Table
connector :str | None
options :str | None
partition_by :str | None
schema :str
static from_dict(data)
Parameters

data (dict) –

Return type

FlinkTablesConfig

catalogs :Dict[str, Catalog]
connectors :Dict[str, Connector]
static from_dict(data)
Parameters

data (dict) –

Return type

FlinkTablesConfig

static from_yml(file_path)
Parameters

file_path (str | None) –

Return type

FlinkTablesConfig

generate_catalog_ddl(self)
Return type

Iterable[tuple[str, str]]

generate_db_ddl(self)
Return type

Iterable[str]

generate_table_ddl(self)
Return type

Iterable[str]

get_connector_options(self, name)
Parameters

name (str) –

Return type

Dict[str, str]

static parse_options(option_str)
Parameters

option_str (str) –

Return type

Dict[str, str]

Previous Next

© Copyright 2022, easysql. Revision 246073b9.

Built with Sphinx using a theme provided by Read the Docs.