diff --git a/metastore/schema_fetch.go b/metastore/schema_fetch.go index cc11051f..2486949f 100644 --- a/metastore/schema_fetch.go +++ b/metastore/schema_fetch.go @@ -70,7 +70,8 @@ func (j *SchemaFetchJob) fetchSchema() { } j.hash = newHash } - utils.GetRootReporter().GetCounter(utils.SchemaFetchSuccess) + utils.GetLogger().Info("Succeeded to run schema fetch job") + utils.GetRootReporter().GetCounter(utils.SchemaFetchSuccess).Inc(1) } func (j *SchemaFetchJob) applySchemaChange(tables []common.Table) (err error) { @@ -131,6 +132,6 @@ func (j *SchemaFetchJob) applySchemaChange(tables []common.Table) (err error) { } func reportError(err error) { - utils.GetRootReporter().GetCounter(utils.SchemaFetchFailure) + utils.GetRootReporter().GetCounter(utils.SchemaFetchFailure).Inc(1) utils.GetLogger().Error(utils.StackError(err, "err running schema fetch job")) } diff --git a/metastore/validator.go b/metastore/validator.go index ad8a87fb..2775de3c 100644 --- a/metastore/validator.go +++ b/metastore/validator.go @@ -167,7 +167,7 @@ func (v tableSchemaValidatorImpl) validateSchemaUpdate(newTable, oldTable *commo // check that no column configs are modified, even for deleted columns if oldCol.Name != newCol.Name || oldCol.Type != newCol.Type || - oldCol.DefaultValue != newCol.DefaultValue || + !reflect.DeepEqual(oldCol.DefaultValue, newCol.DefaultValue) || oldCol.CaseInsensitive != newCol.CaseInsensitive || oldCol.DisableAutoExpand != newCol.DisableAutoExpand { return ErrSchemaUpdateNotAllowed diff --git a/metastore/validator_test.go b/metastore/validator_test.go index 24fa09ce..1f0adaa7 100644 --- a/metastore/validator_test.go +++ b/metastore/validator_test.go @@ -108,6 +108,9 @@ var _ = ginkgo.Describe("Validator", func() { }) ginkgo.It("should be happy with valid updates", func() { + dv1 := "foo" + dv2 := "foo" + oldTable := common.Table{ Name: "testTable", Columns: []common.Column{ @@ -115,6 +118,11 @@ var _ = ginkgo.Describe("Validator", func() { Name: "col1", Type: "Int32", }, + { + Name: "col2", + Type: "SmallEnum", + DefaultValue: &dv1, + }, }, PrimaryKeyColumns: []int{0}, IsFactTable: true, @@ -130,6 +138,11 @@ var _ = ginkgo.Describe("Validator", func() { }, { Name: "col2", + Type: "SmallEnum", + DefaultValue: &dv2, + }, + { + Name: "col3", Type: "Int32", }, },