Skip to content

Commit

Permalink
Add types to field expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
tools4origins committed Sep 26, 2021
1 parent b44adf6 commit b87e861
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pysparkling/sql/expressions/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ def output_fields(self, schema):
def args(self):
return (self.field,)

def data_type(self, schema):
return schema[find_position_in_schema(schema, self.field)].dataType


def find_position_in_schema(schema, expr):
if isinstance(expr, str):
Expand Down

0 comments on commit b87e861

Please sign in to comment.