code: func (s *SelectStatement) GroupByOffset() (time.Duration, error) {
  	interval, err := s.GroupByInterval()
  	if err != nil {
  		return 0, err
  	}
  
  	// Ignore if there are no dimensions.
  	if len(s.Dimensions) == 0 {
  		return 0, nil
  	}
  
  	for _, d := range s.Dimensions {
  		if call, ok := d.Expr.(*Call); ok && call.Name == "time" {
  			if len(call.Args) == 2 {
  				switch expr := call.Args[1].(type) {
  				case *DurationLiteral:
  					return expr.Val % interval, nil
  				case *TimeLiteral:
  					return expr.Val.Sub(expr.Val.Truncate(interval)), nil
  				default:
  					return 0, fmt.Errorf("invalid time dimension offset: %s", expr)
  				}
  			}
  			return 0, nil
  		}
  	}
  	return 0, nil
  }
docs: // GroupByOffset extracts the time interval offset, if specified.