Skip to content

Commit 1cedb4a

Browse files
committed
Add ingestion workflow logic
Code is being migrated from the data repo to import repo
1 parent 95b0633 commit 1cedb4a

27 files changed

Lines changed: 3448 additions & 38 deletions

pipeline/spanner/pom.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,15 @@
7676
<scope>test</scope>
7777
</dependency>
7878
</dependencies>
79+
80+
<build>
81+
<resources>
82+
<resource>
83+
<directory>../workflow/ingestion-helper</directory>
84+
<includes>
85+
<include>schema.sql</include>
86+
</includes>
87+
</resource>
88+
</resources>
89+
</build>
7990
</project>

pipeline/spanner/src/main/java/org/datacommons/ingestion/spanner/SpannerClient.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,17 +231,17 @@ public void validateOrInitializeDatabase() {
231231
}
232232
}
233233

234-
/** Reads DDL statements from the spanner_schema.sql file in the resources directory. */
234+
/** Reads DDL statements from the schema.sql file in the resources directory. */
235235
List<String> readDdlStatements() {
236-
InputStream inputStream = getClass().getClassLoader().getResourceAsStream("spanner_schema.sql");
236+
InputStream inputStream = getClass().getClassLoader().getResourceAsStream("schema.sql");
237237
if (inputStream == null) {
238-
throw new IllegalStateException("Could not find spanner_schema.sql in resources.");
238+
throw new IllegalStateException("Could not find schema.sql in resources.");
239239
}
240240
try (BufferedReader reader =
241241
new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8))) {
242242
return parseDdlStatements(reader);
243243
} catch (IOException e) {
244-
throw new IllegalStateException("Failed to read spanner_schema.sql", e);
244+
throw new IllegalStateException("Failed to read schema.sql", e);
245245
}
246246
}
247247

pipeline/spanner/src/main/resources/spanner_schema.sql

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)