Add JSON Path expression evaluation support (#7315)

- Includes support for FROM clause JSON path
This commit is contained in:
Aditya Manthramurthy
2019-03-09 08:13:37 -08:00
committed by Harshavardhana
parent b296b3cf8b
commit e463386921
15 changed files with 488 additions and 59 deletions

View File

@@ -20,6 +20,7 @@ import (
"bytes"
"encoding/csv"
"encoding/json"
"errors"
"fmt"
"github.com/bcicen/jstream"
@@ -86,6 +87,16 @@ func (r *Record) MarshalJSON() ([]byte, error) {
return json.Marshal(kvs)
}
// Raw - returns the underlying data with format info.
func (r *Record) Raw() (sql.SelectObjectFormat, interface{}) {
return sql.SelectFmtCSV, r
}
// Replace - is not supported for CSV
func (r *Record) Replace(_ jstream.KVS) error {
return errors.New("Replace is not supported for CSV")
}
// NewRecord - creates new CSV record.
func NewRecord() *Record {
return &Record{}