Skip to content

Commit

Permalink
Use SQL context from input DataFrame in transformer (#259)
Browse files Browse the repository at this point in the history
Signed-off-by: Karen Feng <[email protected]>
  • Loading branch information
karenfeng committed Jul 27, 2020
1 parent c8b41ee commit 8e9eee5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions python/glow/glow.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,10 @@ def transform(operation: str,
"""
assert check_argument_types()

sc = SparkContext.getOrCreate(0)
transform_fn = SparkContext._jvm.io.projectglow.Glow.transform
args = arg_map if arg_map is not None else kwargs
output_jdf = transform_fn(operation, df._jdf, args)
output_df = DataFrame(output_jdf, SQLContext.getOrCreate(sc))
output_df = DataFrame(output_jdf, df.sql_ctx)

assert check_return_type(output_df)
return output_df
Expand Down

0 comments on commit 8e9eee5

Please sign in to comment.