What is the difference between class loading classes passed as part of PyFlink pipeline.classpath
config and putting them into a $FLINK_HOME\lib
directory?
When I want to use flink-sql-connector-kafka-*.jar
it works fine just passing it using pipeline.classpath
but when I want to use something that has some external dependencies like flink-avro-*.jar
that needs avro-*.jar
jars. It seems to load flink-avro-*.jar
but it looks like it fails to load avro-*.jar
and throws:
java.lang.NoClassDefFoundError: Could not initialize class org.apache.avro.SchemaBuilder
When I am dding avro-*.jar
to $FLINK_HOME\lib
it works just fine.
NoClassDefFoundError and ClassNotFoundException are different
flink-sql-avro-*.jar is a shaded jar which will relocate the path of org.apache.flink:flink-avro org.apache.avro:avro
Judging from the NoClassDefFoundError, there may be a conflict between the avro version dependencies