Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for PathExpr (0.16 sec)

  1. internal/s3select/sql/utils.go

    	var pathExpr []*JSONPathElement
    	if hasTableAlias {
    		pathExpr = e.PathExpr
    	} else {
    		pathExpr = make([]*JSONPathElement, len(e.PathExpr)+1)
    		pathExpr[0] = &JSONPathElement{Key: &ObjectKey{ID: e.BaseKey}}
    		copy(pathExpr[1:], e.PathExpr)
    	}
    	e.strippedTableAlias = tableAlias
    	e.strippedPathExpr = pathExpr
    	return e.strippedPathExpr
    }
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Wed Nov 10 16:12:50 UTC 2021
    - 3.6K bytes
    - Viewed (0)
  2. internal/s3select/sql/evaluate.go

    	alias := tableAlias
    	if tableAlias == "" {
    		alias = baseTableName
    	}
    	pathExpr := e.StripTableAlias(alias)
    	_, rawVal := r.Raw()
    	switch rowVal := rawVal.(type) {
    	case jstream.KVS, simdjson.Object:
    		if len(pathExpr) == 0 {
    			pathExpr = []*JSONPathElement{{Key: &ObjectKey{ID: e.BaseKey}}}
    		}
    
    		result, _, err := jsonpathEval(pathExpr, rowVal)
    		if err != nil {
    			return nil, err
    		}
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Sep 23 19:35:41 UTC 2024
    - 12K bytes
    - Viewed (0)
  3. internal/s3select/sql/statement.go

    	if !strings.EqualFold(from.Table.BaseKey.String(), baseTableName) {
    		return errBadTableName(errors.New("table name must be `s3object`"))
    	}
    
    	if len(from.Table.PathExpr) > 0 {
    		if !from.Table.PathExpr[0].ArrayWildcard {
    			return errBadTableName(errors.New("keypath table name is invalid - please check the service documentation"))
    		}
    	}
    	return nil
    }
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Sep 23 19:35:41 UTC 2024
    - 8.9K bytes
    - Viewed (0)
  4. internal/s3select/sql/analysis.go

    	}
    	return
    }
    
    func (e *In) analyze(s *Select) (result qProp) {
    	switch {
    	case e.JPathExpr != nil:
    		// Check if the path expression is valid
    		if len(e.JPathExpr.PathExpr) > 0 {
    			if e.JPathExpr.BaseKey.String() != s.From.As && !strings.EqualFold(e.JPathExpr.BaseKey.String(), baseTableName) {
    				result = qProp{err: errInvalidKeypath}
    				return
    			}
    		}
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Sat Dec 23 07:19:11 UTC 2023
    - 8.5K bytes
    - Viewed (0)
  5. internal/s3select/sql/jsonpath_test.go

    			recs, err := getJSONStructs(b)
    			if err != nil || len(recs) != 3 {
    				t.Fatalf("%v or length was not 3", err)
    			}
    
    			for j, rec := range recs {
    				// fmt.Println(rec)
    				r, _, err := jsonpathEval(jp.PathExpr, rec)
    				if err != nil {
    					t.Errorf("Error: %d %d %v", i, j, err)
    				}
    				if !reflect.DeepEqual(r, tc.res[j]) {
    					fmt.Printf("%#v (%v) != %v (%v)\n", r, reflect.TypeOf(r), tc.res[j], reflect.TypeOf(tc.res[j]))
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Sep 23 19:35:41 UTC 2024
    - 2.8K bytes
    - Viewed (0)
  6. internal/s3select/sql/parser.go

    }
    
    // JSONPath represents a keypath.
    // Instances should be treated idempotent and not change once created.
    type JSONPath struct {
    	BaseKey  *Identifier        `parser:" @@"`
    	PathExpr []*JSONPathElement `parser:"(@@)*"`
    
    	// Cached values:
    	pathString         string
    	strippedTableAlias string
    	strippedPathExpr   []*JSONPathElement
    }
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu Jan 18 07:03:17 UTC 2024
    - 12.9K bytes
    - Viewed (0)
Back to top