Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for substring (0.2 sec)

  1. internal/s3select/sql/funceval.go

    func handleUTCNow() (*Value, error) {
    	return FromTimestamp(time.Now().UTC()), nil
    }
    
    func handleSQLSubstring(r Record, e *SubstringFunc, tableAlias string) (val *Value, err error) {
    	// Both forms `SUBSTRING('abc' FROM 2 FOR 1)` and
    	// SUBSTRING('abc', 2, 1) are supported.
    
    	// Evaluate the string argument
    	v1, err := e.Expr.evalNode(r, tableAlias)
    	if err != nil {
    		return nil, err
    	}
    	inferTypeAsString(v1)
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Jun 01 21:59:40 GMT 2021
    - 13.2K bytes
    - Viewed (0)
  2. internal/s3select/sql/parser.go

    	CastType string      `parser:" \"AS\" @(\"BOOL\" | \"INT\" | \"INTEGER\" | \"STRING\" | \"FLOAT\" | \"DECIMAL\" | \"NUMERIC\" | \"TIMESTAMP\") \")\" "`
    }
    
    // SubstringFunc represents SUBSTRING sql function
    type SubstringFunc struct {
    	Expr *PrimaryTerm `parser:" \"SUBSTRING\" \"(\" @@ "`
    	From *Operand     `parser:" ( \"FROM\" @@ "`
    	For  *Operand     `parser:"   (\"FOR\" @@)? \")\" "`
    	Arg2 *Operand     `parser:" | \",\" @@ "`
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 12.9K bytes
    - Viewed (0)
  3. internal/s3select/sql/analysis.go

    		result.combine(e.Substring.Expr.analyze(s))
    		switch {
    		case e.Substring.From != nil:
    			result.combine(e.Substring.From.analyze(s))
    			if e.Substring.For != nil {
    				result.combine(e.Substring.Expr.analyze(s))
    			}
    		case e.Substring.Arg2 != nil:
    			result.combine(e.Substring.Arg2.analyze(s))
    			if e.Substring.Arg3 != nil {
    				result.combine(e.Substring.Arg3.analyze(s))
    			}
    		default:
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Sat Dec 23 07:19:11 GMT 2023
    - 8.5K bytes
    - Viewed (0)
  4. internal/lock/lock_windows_test.go

    	veryLong := "l" + strings.Repeat("o", 248) + "ng"
    	for _, test := range []struct{ in, want string }{
    		// Short; unchanged:
    		{`C:\short.txt`, `C:\short.txt`},
    		{`C:\`, `C:\`},
    		{`C:`, `C:`},
    		// The "long" substring is replaced by a looooooong
    		// string which triggers the rewriting. Except in the
    		// cases below where it doesn't.
    		{`C:\long\foo.txt`, `\\?\C:\long\foo.txt`},
    		{`C:/long/foo.txt`, `\\?\C:\long\foo.txt`},
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Wed Oct 18 18:08:15 GMT 2023
    - 2.2K bytes
    - Viewed (0)
  5. internal/s3select/sql/parser_test.go

    		"extract(YEAR from '2018-01-09')",
    		"extract(month from '2018-01-09')",
    
    		"extract(hour from '2018-01-09')",
    		"extract(day from '2018-01-09')",
    		"substring('abcd' from 2 for 2)",
    		"substring('abcd' from 2)",
    		"substring('abcd' , 2 , 2)",
    
    		"substring('abcd' , 22 )",
    		"trim('  aab  ')",
    		"trim(leading from '  aab  ')",
    		"trim(trailing from '  aab  ')",
    		"trim(both from '  aab  ')",
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 9.2K bytes
    - Viewed (0)
  6. internal/s3select/sql/stringfuncs.go

    var (
    	errMalformedEscapeSequence  = errors.New("Malformed escape sequence in LIKE clause")
    	errInvalidTrimArg           = errors.New("Trim argument is invalid - this should not happen")
    	errInvalidSubstringIndexLen = errors.New("Substring start index or length falls outside the string")
    )
    
    const (
    	percent    rune = '%'
    	underscore rune = '_'
    	runeZero   rune = 0
    )
    
    func evalSQLLike(text, pattern string, escape rune) (match bool, err error) {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Jun 01 21:59:40 GMT 2021
    - 4.2K bytes
    - Viewed (0)
  7. cmd/signature-v4-utils_test.go

    		expected string // expected SHA256
    	}{
    		{"shastring", "", "shastring"},
    		{emptySHA256, "", emptySHA256},
    		{"", "", emptySHA256},
    		{"", "X-Amz-Credential=random", unsignedPayload},
    		{"", "X-Amz-Credential=random&X-Amz-Content-Sha256=" + unsignedPayload, unsignedPayload},
    		{"", "X-Amz-Credential=random&X-Amz-Content-Sha256=shastring", "shastring"},
    	}
    
    	for i, testCase := range testCases {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Apr 05 21:26:41 GMT 2024
    - 14.3K bytes
    - Viewed (0)
  8. internal/s3select/sql/value.go

    		}
    
    		// Fallback to string
    		sA := a.bytesToString()
    		sB := b.bytesToString()
    		a.setString(sA)
    		b.setString(sB)
    		return nil
    
    	case okA && !okB:
    		// Here a has `a` is untyped, but `b` has a fixed
    		// type.
    		switch b.value.(type) {
    		case string:
    			s := a.bytesToString()
    			a.setString(s)
    
    		case int64, float64:
    			if iA, ok := a.bytesToInt(); ok {
    				a.setInt(iA)
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Feb 25 20:31:19 GMT 2022
    - 20.2K bytes
    - Viewed (0)
Back to top