Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for parseSQLTimestamp (0.23 sec)

  1. internal/s3select/sql/timestampfuncs_test.go

    		{"2010-02-03T04:11:30.23-08:00", time.Date(2010, 2, 3, 4, 11, 30, 230000000, fakeLosAngeles)},
    	}
    	for i, tc := range cases {
    		tval, err := parseSQLTimestamp(tc.s)
    		if err != nil {
    			t.Errorf("Case %d: Unexpected error: %v", i+1, err)
    			continue
    		}
    		if !tval.Equal(tc.t) {
    			t.Errorf("Case %d: Expected %v got %v", i+1, tc.t, tval)
    			continue
    		}
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Tue Jun 01 21:59:40 UTC 2021
    - 2.2K bytes
    - Viewed (0)
  2. internal/s3select/sql/timestampfuncs.go

    	layoutNanosecond = "2006-01-02T15:04:05.999999999Z07:00"
    )
    
    var tformats = []string{
    	layoutYear,
    	layoutMonth,
    	layoutDay,
    	layoutMinute,
    	layoutSecond,
    	layoutNanosecond,
    }
    
    func parseSQLTimestamp(s string) (t time.Time, err error) {
    	for _, f := range tformats {
    		t, err = time.Parse(f, s)
    		if err == nil {
    			break
    		}
    	}
    	return
    }
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Sun Jan 02 17:15:06 UTC 2022
    - 4.8K bytes
    - Viewed (0)
  3. internal/s3select/sql/value.go

    	return nil
    }
    
    func inferTypeAsTimestamp(v *Value) error {
    	if s, ok := v.ToString(); ok {
    		t, err := parseSQLTimestamp(s)
    		if err != nil {
    			return err
    		}
    		v.setTimestamp(t)
    	} else if b, ok := v.ToBytes(); ok {
    		s := string(b)
    		t, err := parseSQLTimestamp(s)
    		if err != nil {
    			return err
    		}
    		v.setTimestamp(t)
    	}
    	return nil
    }
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Fri Feb 25 20:31:19 UTC 2022
    - 20.2K bytes
    - Viewed (0)
  4. internal/s3select/sql/funceval.go

    }
    
    func timestampCast(v *Value) (t time.Time, _ error) {
    	switch x := v.value.(type) {
    	case string:
    		return parseSQLTimestamp(x)
    	case []byte:
    		return parseSQLTimestamp(string(x))
    	case time.Time:
    		return x, nil
    	default:
    		return t, errCastFailure(fmt.Sprintf("cannot cast %v to Timestamp type", v.GetTypeString()))
    	}
    }
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Tue Jun 01 21:59:40 UTC 2021
    - 13.2K bytes
    - Viewed (0)
Back to top