Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for WriteCSV (0.09 sec)

  1. internal/s3select/simdj/reader_amd64_test.go

    				opts := sql.WriteCSVOpts{
    					FieldDelimiter: ',',
    					Quote:          '"',
    					QuoteEscape:    '"',
    					AlwaysQuote:    false,
    				}
    				err = rec.WriteCSV(&gotB, opts)
    				if err != nil {
    					t.Error(err)
    				}
    				err = want.WriteCSV(&wantB, opts)
    				if err != nil {
    					t.Error(err)
    				}
    
    				if !bytes.Equal(gotB.Bytes(), wantB.Bytes()) {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Sep 19 18:05:16 UTC 2022
    - 3.9K bytes
    - Viewed (0)
  2. internal/s3select/json/record.go

    	}
    
    	name = strings.ReplaceAll(name, "*", "__ALL__")
    	r.KVS = append(r.KVS, jstream.KV{Key: name, Value: v})
    	return r, nil
    }
    
    // WriteCSV - encodes to CSV data.
    func (r *Record) WriteCSV(writer io.Writer, opts sql.WriteCSVOpts) error {
    	var csvRecord []string
    	for _, kv := range r.KVS {
    		var columnValue string
    		switch val := kv.Value.(type) {
    		case float64:
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Sep 23 19:35:41 UTC 2024
    - 5.3K bytes
    - Viewed (0)
  3. internal/s3select/simdj/record.go

    func (r *Record) Set(name string, value *sql.Value) (sql.Record, error) {
    	dst, err := r.CloneTo(nil)
    	if err != nil {
    		return nil, err
    	}
    	return dst.Set(name, value)
    }
    
    // WriteCSV - encodes to CSV data.
    func (r *Record) WriteCSV(writer io.Writer, opts sql.WriteCSVOpts) error {
    	csvRecord := make([]string, 0, 10)
    	var tmp simdjson.Iter
    	obj := r.object
    allElems:
    	for {
    		_, typ, err := obj.NextElement(&tmp)
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Sep 23 19:35:41 UTC 2024
    - 5.4K bytes
    - Viewed (0)
  4. internal/s3select/csv/record.go

    	}
    	other.columnNames = append(other.columnNames, r.columnNames...)
    	other.csvRecord = append(other.csvRecord, r.csvRecord...)
    	return other
    }
    
    // WriteCSV - encodes to CSV data.
    func (r *Record) WriteCSV(writer io.Writer, opts sql.WriteCSVOpts) error {
    	w := csv.NewWriter(writer)
    	w.Comma = opts.FieldDelimiter
    	w.AlwaysQuote = opts.AlwaysQuote
    	w.Quote = opts.Quote
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Sep 23 19:35:41 UTC 2024
    - 4.1K bytes
    - Viewed (0)
  5. internal/s3select/sql/record.go

    type Record interface {
    	Get(name string) (*Value, error)
    
    	// Set a value.
    	// Can return a different record type.
    	Set(name string, value *Value) (Record, error)
    	WriteCSV(writer io.Writer, opts WriteCSVOpts) error
    	WriteJSON(writer io.Writer) error
    
    	// Clone the record and if possible use the destination provided.
    	Clone(dst Record) Record
    	Reset()
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Tue Jun 01 21:59:40 UTC 2021
    - 3.4K bytes
    - Viewed (0)
  6. internal/s3select/csv/reader_contrib_test.go

    			if err != nil {
    				break
    			}
    			opts := sql.WriteCSVOpts{
    				FieldDelimiter: []rune(c.fieldDelimiter)[0],
    				Quote:          '"',
    				QuoteEscape:    '"',
    				AlwaysQuote:    false,
    			}
    			record.WriteCSV(&result, opts)
    			result.Truncate(result.Len() - 1)
    			result.WriteString(c.recordDelimiter)
    		}
    		r.Close()
    		if err != io.EOF {
    			t.Fatalf("Case %d failed with %s", i, err)
    		}
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Sep 19 18:05:16 UTC 2022
    - 38.5K bytes
    - Viewed (0)
  7. internal/s3select/select.go

    			QuoteEscape:    []rune(s3Select.Output.CSVArgs.QuoteEscapeCharacter)[0],
    			AlwaysQuote:    strings.EqualFold(s3Select.Output.CSVArgs.QuoteFields, "always"),
    		}
    		err := record.WriteCSV(bufioWriter, opts)
    		if err != nil {
    			return err
    		}
    		err = bufioWriter.Flush()
    		if err != nil {
    			return err
    		}
    		if buf.Bytes()[buf.Len()-1] == '\n' {
    			buf.Truncate(buf.Len() - 1)
    		}
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Sun Sep 22 00:33:43 UTC 2024
    - 21.2K bytes
    - Viewed (0)
Back to top