mirror of
https://github.com/minio/minio.git
synced 2025-11-09 21:49:46 -05:00
Rebase minio/parquet-go and fix null handling. (#7067)
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user