Skip to content

Commit

Permalink
[Bug] [Flink]fix add jar some bug (#2974)
Browse files Browse the repository at this point in the history
  • Loading branch information
zackyoungh authored Jan 10, 2024
1 parent 757a298 commit e0ba0c5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 21 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/docker_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ jobs:
key: ${{ runner.os }}-maven-${{ hashFiles('pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
# - name: Check Style
# run: |
# ./mvnw -T 4C -B --no-snapshot-updates clean spotless:check
# - name: Check Style
# run: |
# ./mvnw -T 4C -B --no-snapshot-updates clean spotless:check
- name: Build and Package
run: |
./mvnw -B clean install \
Expand Down Expand Up @@ -114,7 +114,7 @@ jobs:
- uses: actions/checkout@v3
- name: Move Dockerfile
run: |
cp ./docker/Dockerfile* ./
cp -r ./docker/Dockerfile* ./
- name: Download math result for job 1
uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -173,7 +173,7 @@ jobs:
- uses: actions/checkout@v3
- name: Move Dockerfile
run: |
cp ./docker/Dockerfile* ./
cp -r ./docker/Dockerfile* ./
- uses: actions/checkout@v3
- name: set the flink_big_version
run: |
Expand Down Expand Up @@ -204,7 +204,7 @@ jobs:
FLINK_VERSION=${{ matrix.FLINK_VERSION }}
DINKY_IMAGE=${{ matrix.url }}/${{ matrix.namespace }}/dinky-standalone-server:${{ inputs.version }}
FLINK_BIG_VERSION=${{ matrix.FLINK_BIG_VERSION }}
file: ./docker/DockerfileDinkyFlink
file: DockerfileDinkyFlink
context: .
push: true
tags: ${{ matrix.url }}/${{ matrix.namespace }}/dinky-standalone-server:${{ inputs.version }}-flink-${{matrix.FLINK_BIG_VERSION }}
Original file line number Diff line number Diff line change
Expand Up @@ -69,24 +69,12 @@ private static Map<String, Supplier<SinkBuilder>> getPlusSinkBuilder() {
sinkBuilders.add(factory);
}

Map<String, Supplier<SinkBuilder>> plusSinkBuilder = sinkBuilders.stream()
.collect(Collectors.toMap(SinkBuilderFactory::getKeyWord, SinkBuilderFactory::getSupplier));
Map<String, Supplier<SinkBuilder>> plusSinkBuilder =
sinkBuilders.stream().collect(Collectors.toMap(SinkBuilderFactory::getKeyWord, x -> () -> x));
map.putAll(plusSinkBuilder);
return map;
}

@SuppressWarnings("unchecked")
private static Supplier<SinkBuilder> getSupplier(SinkBuilder clazz) {
return () -> {
try {
return SinkBuilder.class.newInstance();
} catch (InstantiationException | IllegalAccessException e) {
logger.warn("Could not get constructor supplier : {}", e.getMessage());
}
return null;
};
}

public static String getKeyWord(SinkBuilder c) {
String fieldName = "KEY_WORD";
String result = null;
Expand Down
2 changes: 1 addition & 1 deletion dinky-core/src/main/java/org/dinky/executor/Executor.java
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ private void addJar(String... jarPath) {
Configuration configuration = tableEnvironment.getRootConfiguration();
List<String> jars = configuration.get(PipelineOptions.JARS);
if (jars == null) {
configuration.set(PipelineOptions.JARS, CollUtil.newArrayList(jarPath));
tableEnvironment.addConfiguration(PipelineOptions.JARS, CollUtil.newArrayList(jarPath));
} else {
CollUtil.addAll(jars, jarPath);
}
Expand Down

0 comments on commit e0ba0c5

Please sign in to comment.