Rebase minio/parquet-go and fix null handling. (#7067)

This commit is contained in:
Bala FA
2019-01-16 21:52:04 +05:30
committed by Nitish Tiwari
parent 63d2583e91
commit e23a42305c
8 changed files with 49 additions and 15 deletions

View File

@@ -58,6 +58,10 @@ func (value *Value) String() string {
// CSVString - encodes to CSV string.
func (value *Value) CSVString() string {
if value.valueType == Null {
return ""
}
return fmt.Sprintf("%v", value.value)
}
@@ -66,6 +70,15 @@ func (value *Value) MarshalJSON() ([]byte, error) {
return json.Marshal(value.value)
}
// NullValue - returns underlying null value. It panics if value is not null type.
func (value *Value) NullValue() *struct{} {
if value.valueType == Null {
return nil
}
panic(fmt.Sprintf("requested bool value but found %T type", value.value))
}
// BoolValue - returns underlying bool value. It panics if value is not Bool type.
func (value *Value) BoolValue() bool {
if value.valueType == Bool {