[ 
https://issues.apache.org/jira/browse/FLINK-25579?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17471970#comment-17471970
 ] 

Darron Fuller commented on FLINK-25579:
---------------------------------------

Thanks [~hxbks2ks]. That was my copy-and-paste mistake. Though my target 
environment is 1.13.2 for compatibility with AWS, I had tried for 1.14.2 as 
well. 

Something I noticed is the signature of .window() is:

def window(self, window: GroupWindow) -> 'GroupWindowedTable'

However, Slide.over('2.hours').every('15.minutes').on('agg_date') results in 
type <pyflink.table.window.SlideWithSizeAndSlideOnTime object at 0x7fbdcdc0a0d0>

Looking at the code, I discovered that I must add .alias() as well.

result = 
in_tbl.select(col('*')).window(Slide.over('2.hours').every('15.minutes').on('agg_date').alias('event_group'))

You can close this issue. Thanks for the quick response!

 

 

> Py4JException: window([class 
> org.apache.flink.table.api.SlideWithSizeAndSlide]) does not exist
> ----------------------------------------------------------------------------------------------
>
>                 Key: FLINK-25579
>                 URL: https://issues.apache.org/jira/browse/FLINK-25579
>             Project: Flink
>          Issue Type: Bug
>    Affects Versions: 1.13.2
>         Environment: Fails in AWS Kinesis Analytics Flink v1.13 and macOS 
> 12.1 (21C52) Darwin 21.2.0, Python 3.8, Java(TM) SE Runtime Environment 
> (build 1.8.0_311-b11)
> Python Packages:
> apache-beam==2.27.0
> apache-flink==1.13.2
> apache-flink-libraries==1.13.2
> avro-python3==1.9.2.1
> certifi==2021.10.8
> charset-normalizer==2.0.10
> click==8.0.3
> cloudpickle==1.2.2
> crcmod==1.7
> dill==0.3.1.1
> docopt==0.6.2
> fastavro==0.23.6
> future==0.18.2
> grpcio==1.43.0
> hdfs==2.6.0
> httplib2==0.17.4
> idna==3.3
> mock==2.0.0
> numpy==1.19.5
> oauth2client==4.1.3
> pandas==1.1.5
> pbr==5.8.0
> protobuf==3.19.1
> py4j==0.10.8.1
> pyarrow==2.0.0
> pyasn1==0.4.8
> pyasn1-modules==0.2.8
> pydot==1.4.2
> pymongo==3.12.3
> pyparsing==3.0.6
> python-dateutil==2.8.0
> pytz==2021.3
> requests==2.27.1
> rsa==4.8
> six==1.16.0
> typing-extensions==3.7.4.3
> urllib3==1.26.8
>   
>            Reporter: Darron Fuller
>            Priority: Major
>
> CODE:
> {quote}in_tbl = create_ingest_table()
> result = 
> in_tbl.select(col('*')).window(Slide.over(lit(2).hours).every(lit(15).minutes))
>  
> {quote}
> STACK TRACE:
> {quote}Traceback (most recent call last):
>   File 
> "/Users/\{redacted}/projects/Comcast/DNSP-IA/streamedge/flink/table_api_agg_5m_window.py",
>  line 54, in <module>
>     main()
>   File 
> "/Users/\{redacted}/projects/Comcast/DNSP-IA/streamedge/flink/table_api_agg_5m_window.py",
>  line 47, in main
>     result = 
> in_tbl.select(col('*')).window(Slide.over('2.hours').every('15.minutes').on('agg_date'))
>   File 
> "/Users/\{redacted}/anaconda3/envs/flink-python38/lib/python3.8/site-packages/pyflink/table/table.py",
>  line 668, in window
>     return GroupWindowedTable(self._j_table.window(window._java_window), 
> self._t_env)
>   File 
> "/Users/\{redacted}/anaconda3/envs/flink-python38/lib/python3.8/site-packages/py4j/java_gateway.py",
>  line 1285, in __call__
>     return_value = get_return_value(
>   File 
> "/Users/\{redacted}/anaconda3/envs/flink-python38/lib/python3.8/site-packages/pyflink/util/exceptions.py",
>  line 146, in deco
>     return f(*a, **kw)
>   File 
> "/Users/\{redacted}/anaconda3/envs/flink-python38/lib/python3.8/site-packages/py4j/protocol.py",
>  line 330, in get_return_value
>     raise Py4JError(
> py4j.protocol.Py4JError: An error occurred while calling o31.window. Trace:
> org.apache.flink.api.python.shaded.py4j.Py4JException: Method window([class 
> org.apache.flink.table.api.SlideWithSizeAndSlideOnTime]) does not exist
> at 
> org.apache.flink.api.python.shaded.py4j.reflection.ReflectionEngine.getMethod(ReflectionEngine.java:318)
> at 
> org.apache.flink.api.python.shaded.py4j.reflection.ReflectionEngine.getMethod(ReflectionEngine.java:326)
> at org.apache.flink.api.python.shaded.py4j.Gateway.invoke(Gateway.java:274)
> at 
> org.apache.flink.api.python.shaded.py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)
> at 
> org.apache.flink.api.python.shaded.py4j.commands.CallCommand.execute(CallCommand.java:79)
> at 
> org.apache.flink.api.python.shaded.py4j.GatewayConnection.run(GatewayConnection.java:238)
> at java.lang.Thread.run(Thread.java:748)
>  
> {quote}
> {color:#a99e8c}JAR FILES IN PYTHON ENVIRONMENT{color}
> {color:#a99e8c}$ jar tf 
> /Users/\{REDACTED}/anaconda3/envs/python38-flink1.14.2/lib/python3.8/site-packages/pyflink/lib/flink-table_2.12-1.14.2.jar
>  | grep SlideWithSizeAndSlide
> org/apache/flink/table/api/SlideWithSizeAndSlide.class
> org/apache/flink/table/api/SlideWithSizeAndSlideOnTime.class
> org/apache/flink/table/api/SlideWithSizeAndSlideOnTimeWithAlias.class{color}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to