Skip to content

Commit

Permalink
Fixed issue where invalid iceberg table was responding back with HTTP…
Browse files Browse the repository at this point in the history
… 500. Upgraded Spring cloud version to Hoxton.SR7 (#405)
  • Loading branch information
ajoymajumdar committed Sep 14, 2020
1 parent 3be795d commit dbb987d
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

# Used in documentation and for including the Gradle plugin
spring_boot_version=2.2.5.RELEASE
spring_cloud_version=Hoxton.SR3
spring_cloud_version=Hoxton.SR7
google_guice_version=4.1.0
spock_version=1.3-groovy-2.5

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ public Client build() {
(int) TimeUnit.MINUTES.toMillis(30));
}
if (logLevel == null) {
logLevel = feign.Logger.Level.NONE;
logLevel = feign.Logger.Level.BASIC;
}
if (client == null) {
client = new feign.Client.Default(null, null);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package com.netflix.metacat.connector.hive.iceberg;

import com.google.common.base.Throwables;
import com.netflix.metacat.common.server.properties.Config;
import org.apache.hadoop.conf.Configuration;
import org.apache.iceberg.BaseMetastoreTableOperations;
import org.apache.iceberg.TableMetadata;
import org.apache.iceberg.exceptions.NotFoundException;
import org.apache.iceberg.hadoop.HadoopFileIO;
import org.apache.iceberg.io.FileIO;

Expand Down Expand Up @@ -50,8 +52,17 @@ public FileIO io() {

@Override
public TableMetadata refresh() {
refreshFromMetadataLocation(this.location, config.getIcebergRefreshFromMetadataLocationRetryNumber());
return super.current();
try {
refreshFromMetadataLocation(this.location, config.getIcebergRefreshFromMetadataLocationRetryNumber());
return super.current();
} catch (Exception e) {
for (Throwable ex : Throwables.getCausalChain(e)) {
if (ex.getMessage().contains("NoSuchKey")) {
throw new NotFoundException(e, String.format("Location %s does not exist", location));
}
}
throw e;
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import com.netflix.metacat.common.exception.MetacatNotFoundException
import com.netflix.metacat.common.exception.MetacatNotSupportedException
import com.netflix.metacat.common.json.MetacatJson
import com.netflix.metacat.common.json.MetacatJsonLocator
import feign.Logger
import org.apache.hadoop.hive.metastore.Warehouse
import org.joda.time.Instant
import org.skyscreamer.jsonassert.JSONAssert
Expand All @@ -54,6 +55,7 @@ class MetacatFunctionalSpec extends Specification {

def client = Client.builder()
.withHost("http:https://localhost:$httpPort")
.withLogLevel(Logger.Level.NONE)
.withDataTypeContext('pig')
.withUserName('metacat-test')
.withClientAppName('metacat-test')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import com.netflix.metacat.common.json.MetacatJsonLocator
import com.netflix.metacat.common.server.connectors.exception.InvalidMetaException
import com.netflix.metacat.connector.hive.util.PartitionUtil
import com.netflix.metacat.testdata.provider.PigDataDtoProvider
import feign.Logger
import groovy.sql.Sql
import org.apache.commons.io.FileUtils
import org.joda.time.Instant
Expand Down Expand Up @@ -65,9 +66,11 @@ class MetacatSmokeSpec extends Specification {
.withHost(url)
.withUserName('metacat-test')
.withClientAppName('metacat-test')
.withLogLevel(Logger.Level.NONE)
.build()
def hiveClient = Client.builder()
.withHost(url)
.withLogLevel(Logger.Level.NONE)
.withDataTypeContext('hive')
.withUserName('metacat-test')
.withClientAppName('metacat-test')
Expand Down

0 comments on commit dbb987d

Please sign in to comment.