File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
src/main/java/com/aliyun/odps Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 1818
1919package com .aliyun .odps ;
2020
21+ import com .aliyun .odps .utils .SqlRunner ;
2122import org .springframework .boot .SpringApplication ;
2223import org .springframework .boot .autoconfigure .SpringBootApplication ;
2324
25+ import java .sql .SQLException ;
26+
2427@ SpringBootApplication
2528public class MaxcomputeEmulatorApplication {
2629
27- public static void main (String [] args ) {
30+ public static void main (String [] args ) throws SQLException {
31+ SqlRunner .executeSql ("CREATE TABLE IF NOT EXISTS schemas(table_name TEXT, schema TEXT);" );
2832 SpringApplication .run (MaxcomputeEmulatorApplication .class , args );
2933 }
3034
Original file line number Diff line number Diff line change @@ -58,9 +58,6 @@ private static void run(String originSql) throws SQLException {
5858 walker .walk (listener , tree );
5959
6060 SqlRunner .executeSql (listener .getResult ());
61- if (!Table .of ("schemas" ).exist ()) {
62- SqlRunner .executeSql ("CREATE TABLE schemas(table_name TEXT, schema TEXT);" );
63- }
6461 SqlRunner .executeSql (
6562 "INSERT INTO schemas VALUES ('" + listener .getTableName () + "', '" + listener .getSchema ().toJson () +
6663 "');" );
You can’t perform that action at this time.
0 commit comments