22
33import com .google .common .collect .Iterators ;
44import com .google .common .collect .Lists ;
5- import org .apache .flink .api .common .typeinfo .TypeInfo ;
65import org .apache .flink .api .common .typeinfo .TypeInformation ;
76import org .apache .flink .api .java .tuple .Tuple2 ;
87import org .apache .flink .api .java .typeutils .RowTypeInfo ;
98import org .apache .flink .shaded .guava18 .com .google .common .base .Splitter ;
109import org .apache .flink .table .api .Types ;
11- import scala .reflect .macros .TypecheckException ;
1210
1311import java .util .ArrayList ;
1412import java .util .regex .Matcher ;
@@ -27,6 +25,11 @@ public class DataTypeUtils {
2725 private final static char FIELD_DELIMITER = ',' ;
2826 private final static char TYPE_DELIMITER = ' ' ;
2927
28+ private final static Pattern COMPLEX_TYPE_PATTERN = Pattern .compile ("^\\ s*(\\ w+)\\ s+(.+?<.+>)\\ s*," );
29+ private final static Pattern ATOMIC_TYPE_PATTERN = Pattern .compile ("^\\ s*(\\ w+)\\ s+(\\ w+)\\ s*," );
30+ private final static Pattern TAIL_PATTERN = Pattern .compile ("^\\ s*(\\ w+)\\ s+(.+?<.+>)\\ s*" );
31+ private final static Pattern ATOMIC_TAIL_PATTERN = Pattern .compile ("^\\ s*(\\ w+)\\ s+(\\ w+)\\ s*" );
32+
3033 private DataTypeUtils () {}
3134
3235 public static TypeInformation convertToCollectionType (String string ) {
@@ -154,4 +157,9 @@ public static TypeInformation convertToAtomicType(String string) {
154157 throw new RuntimeException ("type " + string + "not supported" );
155158 }
156159 }
160+
161+ public static void splitFields (String fieldStmt ) {
162+ // TODO 可以把每轮字符流开始的空白字符去掉。
163+
164+ }
157165}
0 commit comments