File tree Expand file tree Collapse file tree 4 files changed +30
-5
lines changed
flink-sql-runner/src/main/java/com/datasqrl/flinkrunner Expand file tree Collapse file tree 4 files changed +30
-5
lines changed Original file line number Diff line number Diff line change 2121import javax .annotation .Nullable ;
2222import lombok .RequiredArgsConstructor ;
2323import lombok .extern .slf4j .Slf4j ;
24- import org .apache .commons .lang3 .StringUtils ;
2524import org .apache .flink .annotation .VisibleForTesting ;
2625import org .apache .flink .api .common .RuntimeExecutionMode ;
2726import org .apache .flink .configuration .Configuration ;
@@ -52,12 +51,12 @@ public TableResult run() throws Exception {
5251 TableResult run (Supplier <SqlExecutor > sqlExecutorSupplier ) throws Exception {
5352 var sqlExecutor = sqlExecutorSupplier .get ();
5453
55- if (StringUtils .isNoneBlank (sqlFile , planFile )) {
54+ if (StringUtils .isNotBlank (sqlFile ) && StringUtils . isNotBlank ( planFile )) {
5655 throw new IllegalArgumentException (
5756 "Provide either a SQL file or a compiled plan - not both." );
5857 }
5958
60- if (StringUtils .isAllBlank (sqlFile , planFile )) {
59+ if (StringUtils .isBlank (sqlFile ) && StringUtils . isBlank ( planFile )) {
6160 throw new IllegalArgumentException (
6261 "Invalid input. Please provide one of the following combinations: 1. A single SQL file (--sqlfile) 2. A plan JSON file (--planfile)" );
6362 }
Original file line number Diff line number Diff line change 2121import java .util .regex .Matcher ;
2222import java .util .regex .Pattern ;
2323import lombok .extern .slf4j .Slf4j ;
24- import org .apache .commons .lang3 .StringUtils ;
2524import org .apache .flink .shaded .jackson2 .com .fasterxml .jackson .core .JsonParser ;
2625import org .apache .flink .shaded .jackson2 .com .fasterxml .jackson .databind .DeserializationContext ;
2726import org .apache .flink .shaded .jackson2 .com .fasterxml .jackson .databind .JsonDeserializer ;
Original file line number Diff line number Diff line change 2929import lombok .AccessLevel ;
3030import lombok .RequiredArgsConstructor ;
3131import lombok .extern .slf4j .Slf4j ;
32- import org .apache .commons .lang3 .StringUtils ;
3332import org .apache .flink .annotation .VisibleForTesting ;
3433import org .apache .flink .api .java .tuple .Tuple2 ;
3534import org .apache .flink .configuration .Configuration ;
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright © 2025 DataSQRL (contact@datasqrl.com)
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+ package com .datasqrl .flinkrunner ;
17+
18+ /** Utility class for string operations. */
19+ final class StringUtils {
20+
21+ static boolean isBlank (String str ) {
22+ return str == null || str .trim ().isEmpty ();
23+ }
24+
25+ static boolean isNotBlank (String str ) {
26+ return !isBlank (str );
27+ }
28+ }
You can’t perform that action at this time.
0 commit comments