Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. singleStringOfDelimitedNames= '|'.join([str(x.asDict().values()[0]) for x in
  2. df3.collect()])
  3.  
  4. df2 = sqlContext.sql("""SELECT field1, field2
  5. FROM
  6. refinedTable
  7. WHERE
  8. createdHiveUDF({0}, {1}, cast(field1 as string), cast(field2 as string))
  9. """.format(percentage, singleStringOfDelimitedNames))
  10.  
  11. df2 = sqlContext.sql("""SELECT field1, field2
  12. FROM
  13. refinedTable
  14. WHERE
  15. createdHiveUDF({0}, 'Dan|Susie Ann|Bob', cast(field1 as string), cast(field2 as string))
  16. """.format(percentage))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement