Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#58 Null pointer exception when reading with the java API without sto… #59

Merged
merged 1 commit into from
Jul 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ public void saveFeatureGroup(FeatureGroup featureGroup, Dataset<Row> dataset,
public void saveDataframe(FeatureGroup featureGroup, Dataset<Row> dataset, Storage storage,
SaveMode saveMode, Map<String, String> writeOptions)
throws IOException, FeatureStoreException {
if (storage == null) {
throw new FeatureStoreException("Storage not supported");
}

switch (storage) {
case OFFLINE:
saveOfflineDataframe(featureGroup, dataset, saveMode, writeOptions);
Expand Down
5 changes: 5 additions & 0 deletions java/src/main/java/com/logicalclocks/hsfs/metadata/Query.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,14 @@ public void show(int numRows) throws FeatureStoreException, IOException {
}

public Dataset<Row> read(Storage storage) throws FeatureStoreException, IOException {
if (storage == null) {
throw new FeatureStoreException("Storage not supported");
}

String sqlQuery =
queryConstructorApi.constructQuery(leftFeatureGroup.getFeatureStore(), this).getStorageQuery(storage);
LOGGER.info("Executing query: " + sqlQuery);

switch (storage) {
case OFFLINE:
return SparkEngine.getInstance().sql(sqlQuery);
Expand Down