MCPcopy Create free account
hub / github.com/apache/impala / choose_val_expr

Method choose_val_expr

tests/comparison/query_profile.py:444–453  ·  view source on GitHub ↗
(self, val_exprs, types=TYPES)

Source from the content-addressed store, hash-verified

442 return 'DEFAULT'
443
444 def choose_val_expr(self, val_exprs, types=TYPES):
445 if not val_exprs:
446 raise Exception('At least on value is required')
447 if not types:
448 raise Exception('At least one type is required')
449 available_types = set(types) & set(val_exprs.by_type)
450 if not available_types:
451 raise Exception('None of the provided values return any of the required types')
452 val_type = self.choose_type(available_types)
453 return choice(val_exprs.by_type[val_type])
454
455 def choose_constant(self, return_type=None, allow_null=True):
456 if not return_type:

Callers 2

Calls 1

choose_typeMethod · 0.95

Tested by

no test coverage detected