项目引用flink-1.11.0,打包失败

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

项目引用flink-1.11.0,打包失败

Zhou Zach


flink-1.10.0版本,引用的是org.apache.flink.table.api.java.StreamTableEnvironment,换成flink-1.11.0时,intellij idea提示要换成org.apache.flink.table.api.bridge.java.StreamTableEnvironment,Intellij Idea Build可以成功,就是打包的时候出错。。




[ERROR] /Users/Zach/flink-common_1.11.0/src/main/scala/org/rabbit/sql/FromKafkaSinkJdbcForUserUV.scala:7: error: object StreamTableEnvironment is not a member of package org.apache.flink.table.api.bridge.java
[ERROR] import org.apache.flink.table.api.bridge.java.StreamTableEnvironment




代码:
val streamExecutionEnv = StreamExecutionEnvironment.getExecutionEnvironment
streamExecutionEnv.setStreamTimeCharacteristic(TimeCharacteristic.EventTime)
streamExecutionEnv.enableCheckpointing(20 * 1000, CheckpointingMode.EXACTLY_ONCE)
streamExecutionEnv.getCheckpointConfig.setCheckpointTimeout(900 * 1000)

val blinkEnvSettings = EnvironmentSettings.newInstance().useBlinkPlanner().inStreamingMode().build()
val streamTableEnv = StreamTableEnvironment.create(streamExecutionEnv, blinkEnvSettings)
pom.xml:
<properties>
      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!--      <flink.version>1.10.0</flink.version>-->
<flink.version>1.11-SNAPSHOT</flink.version>
      <java.version>1.8</java.version>
      <scala.version>2.11.12</scala.version>
      <scala.binary.version>2.11</scala.binary.version>
      <maven.compiler.source>${java.version}</maven.compiler.source>
      <maven.compiler.target>${java.version}</maven.compiler.target>
   </properties>
<dependency>
         <groupId>org.apache.flink</groupId>
         <artifactId>flink-java</artifactId>
         <version>${flink.version}</version>
<!--         <scope>provided</scope>-->
</dependency>
      <dependency>
         <groupId>org.apache.flink</groupId>
         <artifactId>flink-streaming-java_${scala.binary.version}</artifactId>
         <version>${flink.version}</version>
<!--         <scope>provided</scope>-->
</dependency>

<!-- https://mvnrepository.com/artifact/org.apache.flink/flink-table -->
<dependency>
         <groupId>org.apache.flink</groupId>
         <artifactId>flink-table</artifactId>
         <version>${flink.version}</version>
         <type>pom</type>
<!--         <scope>provided</scope>-->
</dependency>

      <dependency>
         <groupId>org.apache.flink</groupId>
         <artifactId>flink-scala_2.11</artifactId>
         <version>${flink.version}</version>
<!--         <scope>provided</scope>-->
</dependency>
      <dependency>
         <groupId>org.apache.flink</groupId>
         <artifactId>flink-jdbc_2.11</artifactId>
         <version>${flink.version}</version>
         <scope>provided</scope>
      </dependency>

      <dependency>
         <groupId>org.apache.flink</groupId>
         <artifactId>flink-streaming-scala_2.11</artifactId>
         <version>${flink.version}</version>
<!--         <scope>provided</scope>-->
</dependency>

      <dependency>
         <groupId>org.apache.flink</groupId>
         <artifactId>flink-table-common</artifactId>
         <version>${flink.version}</version>
<!--         <scope>provided</scope>-->
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.flink/flink-table-api-scala-bridge -->
<dependency>
         <groupId>org.apache.flink</groupId>
         <artifactId>flink-table-api-scala-bridge_2.11</artifactId>
         <version>${flink.version}</version>
<!--         <scope>provided</scope>-->
</dependency>

<!-- https://mvnrepository.com/artifact/org.apache.flink/flink-table-api-scala -->
<dependency>
         <groupId>org.apache.flink</groupId>
         <artifactId>flink-table-api-scala_2.11</artifactId>
         <version>${flink.version}</version>
<!--         <scope>provided</scope>-->
</dependency>




<!-- Add connector dependencies here. They must be in the default scope (compile). -->

      <!-- Add logging framework, to produce console output when running in the IDE. -->
      <!-- These dependencies are excluded from the application JAR by default. -->


<dependency>
         <groupId>org.apache.flink</groupId>
         <artifactId>flink-connector-kafka_2.11</artifactId>
         <version>${flink.version}</version>
         <scope>provided</scope>
      </dependency>
      <dependency>
         <groupId>org.apache.flink</groupId>
         <artifactId>flink-avro</artifactId>
         <version>${flink.version}</version>
         <scope>provided</scope>
      </dependency>
      <dependency>
         <groupId>org.apache.flink</groupId>
         <artifactId>flink-csv</artifactId>
         <version>${flink.version}</version>
         <scope>provided</scope>
      </dependency>
<!-- https://mvnrepository.com/artifact/org.apache.flink/flink-json -->
<dependency>
         <groupId>org.apache.flink</groupId>
         <artifactId>flink-json</artifactId>
         <version>${flink.version}</version>
         <scope>provided</scope>
      </dependency>


<!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->


<dependency>
         <groupId>org.apache.bahir</groupId>
         <artifactId>flink-connector-redis_2.11</artifactId>
         <version>1.0</version>
         <scope>provided</scope>
      </dependency>

<!-- Flink Dependency -->
<dependency>
         <groupId>org.apache.flink</groupId>
         <artifactId>flink-connector-hive_2.11</artifactId>
         <version>${flink.version}</version>
         <scope>provided</scope>
      </dependency>

<!--      <dependency>-->
<!--         <groupId>org.apache.flink</groupId>-->
<!--         <artifactId>flink-table-api-java-bridge_2.11</artifactId>-->
<!--         <version>${flink.version}</version>-->
<!--         <scope>provided</scope>-->
<!--      </dependency>-->

<dependency>
         <groupId>org.apache.flink</groupId>
         <artifactId>flink-table-api-java</artifactId>
         <version>${flink.version}</version>
         <scope>provided</scope>
      </dependency>

<!-- https://mvnrepository.com/artifact/org.apache.flink/flink-table-planner -->
<dependency>
         <groupId>org.apache.flink</groupId>
         <artifactId>flink-table-planner_2.11</artifactId>
         <version>${flink.version}</version>
<!--         <scope>provided</scope>-->
</dependency>

      <dependency>
         <groupId>org.apache.flink</groupId>
         <artifactId>flink-table-planner-blink_2.11</artifactId>
         <version>${flink.version}</version>
         <scope>provided</scope>
      </dependency>
<!-- https://mvnrepository.com/artifact/org.apache.flink/flink-sql-connector-kafka -->
<dependency>
         <groupId>org.apache.flink</groupId>
         <artifactId>flink-sql-connector-kafka_2.11</artifactId>
         <version>${flink.version}</version>
         <scope>provided</scope>
      </dependency>


      <dependency>
         <groupId>org.apache.flink</groupId>
         <artifactId>flink-connector-hbase_2.11</artifactId>
         <version>${flink.version}</version>
      </dependency>
Reply | Threaded
Open this post in threaded view
|

Re: 项目引用flink-1.11.0,打包失败

Jark
Administrator
能贴下完整代码吗? (imports 部分)

Best,
Jark

On Thu, 18 Jun 2020 at 19:18, Zhou Zach <[hidden email]> wrote:

>
>
> flink-1.10.0版本,引用的是org.apache.flink.table.api.java.StreamTableEnvironment,换成flink-1.11.0时,intellij
> idea提示要换成org.apache.flink.table.api.bridge.java.StreamTableEnvironment,Intellij
> Idea Build可以成功,就是打包的时候出错。。
>
>
>
>
> [ERROR]
> /Users/Zach/flink-common_1.11.0/src/main/scala/org/rabbit/sql/FromKafkaSinkJdbcForUserUV.scala:7:
> error: object StreamTableEnvironment is not a member of package
> org.apache.flink.table.api.bridge.java
> [ERROR] import
> org.apache.flink.table.api.bridge.java.StreamTableEnvironment
>
>
>
>
> 代码:
> val streamExecutionEnv = StreamExecutionEnvironment.getExecutionEnvironment
>
> streamExecutionEnv.setStreamTimeCharacteristic(TimeCharacteristic.EventTime)
> streamExecutionEnv.enableCheckpointing(20 * 1000,
> CheckpointingMode.EXACTLY_ONCE)
> streamExecutionEnv.getCheckpointConfig.setCheckpointTimeout(900 * 1000)
>
> val blinkEnvSettings =
> EnvironmentSettings.newInstance().useBlinkPlanner().inStreamingMode().build()
> val streamTableEnv = StreamTableEnvironment.create(streamExecutionEnv,
> blinkEnvSettings)
> pom.xml:
> <properties>
>       <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
> <!--      <flink.version>1.10.0</flink.version>-->
> <flink.version>1.11-SNAPSHOT</flink.version>
>       <java.version>1.8</java.version>
>       <scala.version>2.11.12</scala.version>
>       <scala.binary.version>2.11</scala.binary.version>
>       <maven.compiler.source>${java.version}</maven.compiler.source>
>       <maven.compiler.target>${java.version}</maven.compiler.target>
>    </properties>
> <dependency>
>          <groupId>org.apache.flink</groupId>
>          <artifactId>flink-java</artifactId>
>          <version>${flink.version}</version>
> <!--         <scope>provided</scope>-->
> </dependency>
>       <dependency>
>          <groupId>org.apache.flink</groupId>
>
>  <artifactId>flink-streaming-java_${scala.binary.version}</artifactId>
>          <version>${flink.version}</version>
> <!--         <scope>provided</scope>-->
> </dependency>
>
> <!-- https://mvnrepository.com/artifact/org.apache.flink/flink-table -->
> <dependency>
>          <groupId>org.apache.flink</groupId>
>          <artifactId>flink-table</artifactId>
>          <version>${flink.version}</version>
>          <type>pom</type>
> <!--         <scope>provided</scope>-->
> </dependency>
>
>       <dependency>
>          <groupId>org.apache.flink</groupId>
>          <artifactId>flink-scala_2.11</artifactId>
>          <version>${flink.version}</version>
> <!--         <scope>provided</scope>-->
> </dependency>
>       <dependency>
>          <groupId>org.apache.flink</groupId>
>          <artifactId>flink-jdbc_2.11</artifactId>
>          <version>${flink.version}</version>
>          <scope>provided</scope>
>       </dependency>
>
>       <dependency>
>          <groupId>org.apache.flink</groupId>
>          <artifactId>flink-streaming-scala_2.11</artifactId>
>          <version>${flink.version}</version>
> <!--         <scope>provided</scope>-->
> </dependency>
>
>       <dependency>
>          <groupId>org.apache.flink</groupId>
>          <artifactId>flink-table-common</artifactId>
>          <version>${flink.version}</version>
> <!--         <scope>provided</scope>-->
> </dependency>
> <!--
> https://mvnrepository.com/artifact/org.apache.flink/flink-table-api-scala-bridge
> -->
> <dependency>
>          <groupId>org.apache.flink</groupId>
>          <artifactId>flink-table-api-scala-bridge_2.11</artifactId>
>          <version>${flink.version}</version>
> <!--         <scope>provided</scope>-->
> </dependency>
>
> <!--
> https://mvnrepository.com/artifact/org.apache.flink/flink-table-api-scala
> -->
> <dependency>
>          <groupId>org.apache.flink</groupId>
>          <artifactId>flink-table-api-scala_2.11</artifactId>
>          <version>${flink.version}</version>
> <!--         <scope>provided</scope>-->
> </dependency>
>
>
>
>
> <!-- Add connector dependencies here. They must be in the default scope
> (compile). -->
>
>       <!-- Add logging framework, to produce console output when running
> in the IDE. -->
>       <!-- These dependencies are excluded from the application JAR by
> default. -->
>
>
> <dependency>
>          <groupId>org.apache.flink</groupId>
>          <artifactId>flink-connector-kafka_2.11</artifactId>
>          <version>${flink.version}</version>
>          <scope>provided</scope>
>       </dependency>
>       <dependency>
>          <groupId>org.apache.flink</groupId>
>          <artifactId>flink-avro</artifactId>
>          <version>${flink.version}</version>
>          <scope>provided</scope>
>       </dependency>
>       <dependency>
>          <groupId>org.apache.flink</groupId>
>          <artifactId>flink-csv</artifactId>
>          <version>${flink.version}</version>
>          <scope>provided</scope>
>       </dependency>
> <!-- https://mvnrepository.com/artifact/org.apache.flink/flink-json -->
> <dependency>
>          <groupId>org.apache.flink</groupId>
>          <artifactId>flink-json</artifactId>
>          <version>${flink.version}</version>
>          <scope>provided</scope>
>       </dependency>
>
>
> <!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
>
>
> <dependency>
>          <groupId>org.apache.bahir</groupId>
>          <artifactId>flink-connector-redis_2.11</artifactId>
>          <version>1.0</version>
>          <scope>provided</scope>
>       </dependency>
>
> <!-- Flink Dependency -->
> <dependency>
>          <groupId>org.apache.flink</groupId>
>          <artifactId>flink-connector-hive_2.11</artifactId>
>          <version>${flink.version}</version>
>          <scope>provided</scope>
>       </dependency>
>
> <!--      <dependency>-->
> <!--         <groupId>org.apache.flink</groupId>-->
> <!--         <artifactId>flink-table-api-java-bridge_2.11</artifactId>-->
> <!--         <version>${flink.version}</version>-->
> <!--         <scope>provided</scope>-->
> <!--      </dependency>-->
>
> <dependency>
>          <groupId>org.apache.flink</groupId>
>          <artifactId>flink-table-api-java</artifactId>
>          <version>${flink.version}</version>
>          <scope>provided</scope>
>       </dependency>
>
> <!--
> https://mvnrepository.com/artifact/org.apache.flink/flink-table-planner
> -->
> <dependency>
>          <groupId>org.apache.flink</groupId>
>          <artifactId>flink-table-planner_2.11</artifactId>
>          <version>${flink.version}</version>
> <!--         <scope>provided</scope>-->
> </dependency>
>
>       <dependency>
>          <groupId>org.apache.flink</groupId>
>          <artifactId>flink-table-planner-blink_2.11</artifactId>
>          <version>${flink.version}</version>
>          <scope>provided</scope>
>       </dependency>
> <!--
> https://mvnrepository.com/artifact/org.apache.flink/flink-sql-connector-kafka
> -->
> <dependency>
>          <groupId>org.apache.flink</groupId>
>          <artifactId>flink-sql-connector-kafka_2.11</artifactId>
>          <version>${flink.version}</version>
>          <scope>provided</scope>
>       </dependency>
>
>
>       <dependency>
>          <groupId>org.apache.flink</groupId>
>          <artifactId>flink-connector-hbase_2.11</artifactId>
>          <version>${flink.version}</version>
>       </dependency>
Reply | Threaded
Open this post in threaded view
|

Re:Re: 项目引用flink-1.11.0,打包失败

Zhou Zach
import org.apache.flink.api.common.time.Time
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment
import org.apache.flink.streaming.api.{CheckpointingMode, TimeCharacteristic}
import org.apache.flink.table.api.EnvironmentSettings
import org.apache.flink.table.api.bridge.java.StreamTableEnvironment

















在 2020-06-18 19:41:08,"Jark Wu" <[hidden email]> 写道:

>能贴下完整代码吗? (imports 部分)
>
>Best,
>Jark
>
>On Thu, 18 Jun 2020 at 19:18, Zhou Zach <[hidden email]> wrote:
>
>>
>>
>> flink-1.10.0版本,引用的是org.apache.flink.table.api.java.StreamTableEnvironment,换成flink-1.11.0时,intellij
>> idea提示要换成org.apache.flink.table.api.bridge.java.StreamTableEnvironment,Intellij
>> Idea Build可以成功,就是打包的时候出错。。
>>
>>
>>
>>
>> [ERROR]
>> /Users/Zach/flink-common_1.11.0/src/main/scala/org/rabbit/sql/FromKafkaSinkJdbcForUserUV.scala:7:
>> error: object StreamTableEnvironment is not a member of package
>> org.apache.flink.table.api.bridge.java
>> [ERROR] import
>> org.apache.flink.table.api.bridge.java.StreamTableEnvironment
>>
>>
>>
>>
>> 代码:
>> val streamExecutionEnv = StreamExecutionEnvironment.getExecutionEnvironment
>>
>> streamExecutionEnv.setStreamTimeCharacteristic(TimeCharacteristic.EventTime)
>> streamExecutionEnv.enableCheckpointing(20 * 1000,
>> CheckpointingMode.EXACTLY_ONCE)
>> streamExecutionEnv.getCheckpointConfig.setCheckpointTimeout(900 * 1000)
>>
>> val blinkEnvSettings =
>> EnvironmentSettings.newInstance().useBlinkPlanner().inStreamingMode().build()
>> val streamTableEnv = StreamTableEnvironment.create(streamExecutionEnv,
>> blinkEnvSettings)
>> pom.xml:
>> <properties>
>>       <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>> <!--      <flink.version>1.10.0</flink.version>-->
>> <flink.version>1.11-SNAPSHOT</flink.version>
>>       <java.version>1.8</java.version>
>>       <scala.version>2.11.12</scala.version>
>>       <scala.binary.version>2.11</scala.binary.version>
>>       <maven.compiler.source>${java.version}</maven.compiler.source>
>>       <maven.compiler.target>${java.version}</maven.compiler.target>
>>    </properties>
>> <dependency>
>>          <groupId>org.apache.flink</groupId>
>>          <artifactId>flink-java</artifactId>
>>          <version>${flink.version}</version>
>> <!--         <scope>provided</scope>-->
>> </dependency>
>>       <dependency>
>>          <groupId>org.apache.flink</groupId>
>>
>>  <artifactId>flink-streaming-java_${scala.binary.version}</artifactId>
>>          <version>${flink.version}</version>
>> <!--         <scope>provided</scope>-->
>> </dependency>
>>
>> <!-- https://mvnrepository.com/artifact/org.apache.flink/flink-table -->
>> <dependency>
>>          <groupId>org.apache.flink</groupId>
>>          <artifactId>flink-table</artifactId>
>>          <version>${flink.version}</version>
>>          <type>pom</type>
>> <!--         <scope>provided</scope>-->
>> </dependency>
>>
>>       <dependency>
>>          <groupId>org.apache.flink</groupId>
>>          <artifactId>flink-scala_2.11</artifactId>
>>          <version>${flink.version}</version>
>> <!--         <scope>provided</scope>-->
>> </dependency>
>>       <dependency>
>>          <groupId>org.apache.flink</groupId>
>>          <artifactId>flink-jdbc_2.11</artifactId>
>>          <version>${flink.version}</version>
>>          <scope>provided</scope>
>>       </dependency>
>>
>>       <dependency>
>>          <groupId>org.apache.flink</groupId>
>>          <artifactId>flink-streaming-scala_2.11</artifactId>
>>          <version>${flink.version}</version>
>> <!--         <scope>provided</scope>-->
>> </dependency>
>>
>>       <dependency>
>>          <groupId>org.apache.flink</groupId>
>>          <artifactId>flink-table-common</artifactId>
>>          <version>${flink.version}</version>
>> <!--         <scope>provided</scope>-->
>> </dependency>
>> <!--
>> https://mvnrepository.com/artifact/org.apache.flink/flink-table-api-scala-bridge
>> -->
>> <dependency>
>>          <groupId>org.apache.flink</groupId>
>>          <artifactId>flink-table-api-scala-bridge_2.11</artifactId>
>>          <version>${flink.version}</version>
>> <!--         <scope>provided</scope>-->
>> </dependency>
>>
>> <!--
>> https://mvnrepository.com/artifact/org.apache.flink/flink-table-api-scala
>> -->
>> <dependency>
>>          <groupId>org.apache.flink</groupId>
>>          <artifactId>flink-table-api-scala_2.11</artifactId>
>>          <version>${flink.version}</version>
>> <!--         <scope>provided</scope>-->
>> </dependency>
>>
>>
>>
>>
>> <!-- Add connector dependencies here. They must be in the default scope
>> (compile). -->
>>
>>       <!-- Add logging framework, to produce console output when running
>> in the IDE. -->
>>       <!-- These dependencies are excluded from the application JAR by
>> default. -->
>>
>>
>> <dependency>
>>          <groupId>org.apache.flink</groupId>
>>          <artifactId>flink-connector-kafka_2.11</artifactId>
>>          <version>${flink.version}</version>
>>          <scope>provided</scope>
>>       </dependency>
>>       <dependency>
>>          <groupId>org.apache.flink</groupId>
>>          <artifactId>flink-avro</artifactId>
>>          <version>${flink.version}</version>
>>          <scope>provided</scope>
>>       </dependency>
>>       <dependency>
>>          <groupId>org.apache.flink</groupId>
>>          <artifactId>flink-csv</artifactId>
>>          <version>${flink.version}</version>
>>          <scope>provided</scope>
>>       </dependency>
>> <!-- https://mvnrepository.com/artifact/org.apache.flink/flink-json -->
>> <dependency>
>>          <groupId>org.apache.flink</groupId>
>>          <artifactId>flink-json</artifactId>
>>          <version>${flink.version}</version>
>>          <scope>provided</scope>
>>       </dependency>
>>
>>
>> <!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
>>
>>
>> <dependency>
>>          <groupId>org.apache.bahir</groupId>
>>          <artifactId>flink-connector-redis_2.11</artifactId>
>>          <version>1.0</version>
>>          <scope>provided</scope>
>>       </dependency>
>>
>> <!-- Flink Dependency -->
>> <dependency>
>>          <groupId>org.apache.flink</groupId>
>>          <artifactId>flink-connector-hive_2.11</artifactId>
>>          <version>${flink.version}</version>
>>          <scope>provided</scope>
>>       </dependency>
>>
>> <!--      <dependency>-->
>> <!--         <groupId>org.apache.flink</groupId>-->
>> <!--         <artifactId>flink-table-api-java-bridge_2.11</artifactId>-->
>> <!--         <version>${flink.version}</version>-->
>> <!--         <scope>provided</scope>-->
>> <!--      </dependency>-->
>>
>> <dependency>
>>          <groupId>org.apache.flink</groupId>
>>          <artifactId>flink-table-api-java</artifactId>
>>          <version>${flink.version}</version>
>>          <scope>provided</scope>
>>       </dependency>
>>
>> <!--
>> https://mvnrepository.com/artifact/org.apache.flink/flink-table-planner
>> -->
>> <dependency>
>>          <groupId>org.apache.flink</groupId>
>>          <artifactId>flink-table-planner_2.11</artifactId>
>>          <version>${flink.version}</version>
>> <!--         <scope>provided</scope>-->
>> </dependency>
>>
>>       <dependency>
>>          <groupId>org.apache.flink</groupId>
>>          <artifactId>flink-table-planner-blink_2.11</artifactId>
>>          <version>${flink.version}</version>
>>          <scope>provided</scope>
>>       </dependency>
>> <!--
>> https://mvnrepository.com/artifact/org.apache.flink/flink-sql-connector-kafka
>> -->
>> <dependency>
>>          <groupId>org.apache.flink</groupId>
>>          <artifactId>flink-sql-connector-kafka_2.11</artifactId>
>>          <version>${flink.version}</version>
>>          <scope>provided</scope>
>>       </dependency>
>>
>>
>>       <dependency>
>>          <groupId>org.apache.flink</groupId>
>>          <artifactId>flink-connector-hbase_2.11</artifactId>
>>          <version>${flink.version}</version>
>>       </dependency>