sunjincheng121 commented on a change in pull request #8401: [FLINK-12407][python] Add all table operators align Java Table API. URL: https://github.com/apache/flink/pull/8401#discussion_r283599842
########## File path: flink-python/pyflink/table/table.py ########## @@ -118,3 +463,112 @@ def insert_into(self, table_name): :param table_name: Name of the :class:`TableSink` to which the :class:`Table` is written. """ self._j_table.insertInto(table_name) + + def __str__(self): + return self._j_table.toString() + + +class GroupedTable(object): + """ + A table that has been grouped on a set of grouping keys. + """ + + def __init__(self, java_table): + self._j_table = java_table + + def select(self, fields): + """ + Performs a selection operation on a grouped table. Similar to an SQL SELECT statement. + The field expressions can contain complex expressions and aggregations. + + Example: + :: + >>> tab.group_by("key").select("key, value.avg + ' The average' as average") + + + :param fields: Expression string that contains group keys and aggregate function calls. + :return: Result table. + """ + return Table(self._j_table.select(fields)) + + +class GroupWindowedTable(object): + """ + A table that has been windowed for :class:`GroupWindow`s. + """ + + def __init__(self, java_group_windowed_table): + self._java_table = java_group_windowed_table Review comment: Both `_j_table` and `_j_group_windowed_table` are makes sense to me. Because if we using `_j_table` all JVM *table and be ref by `_j_table`. if we using ` _j_group_windowed_table` we also need `_j_over_windowed_table`, `_j_windowed_grouped_table` etc. For simple, I prefer using `_j_table` for all of the class in `Table.py`? What do you think? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services