SHARE
TWEET

Untitled

a guest May 19th, 2019 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Version1
  2. val timeTravelDF_1 = Spark.read.format("delta").option("versionAsOf", 0).load("/delta-table/product")
  3.   timeTravelDF_1.show()
  4.  
  5.   /*+---+---------+---------+-----+----------------+---------+-----+-----+-------+------+
  6. | id|firstName| lastName|house|          street|     city|state|  zip|   prod|   tag|
  7. +---+---------+---------+-----+----------------+---------+-----+-----+-------+------+
  8. |  1|  Micheal|   Adkins|   19|    Ofuca Avenue| Kopewevi|   PA|77774|   Misc| GREEN|
  9. |  2|   Rachel|    Parks|   19|     Itmer Manor| Wejitcan|   AR|64675|Desktop|YELLOW|
  10. |  3|   Julian|    Olson|   47| Pewih Boulevard| Lithejev|   NH|27953|Desktop|  BLUE|
  11. |  4|     Carl|  Kennedy|   62|  Pekibu Highway| Jerhivme|   WV|51677|   Misc|  BLUE|
  12. |  5|     Earl|Armstrong|   47|  Rejo Extension| Febugiro|   MO|05472| Laptop|YELLOW|
  13. |  6|    Della|Armstrong|   25|    Febro Street| Wivgufiv|   MD|28380|Desktop|  BLUE|
  14. |  7|   Milton|   George|   44|    Febos Circle|  Nuwacof|   MO|58670| Laptop|   RED|
  15. |  8|  Jeffery|   Hughes|   39|      Zivve Park|  Dirhako|   NJ|03544|  Phone|   RED|
  16. |  9|     Lura|   Thomas|   21|       Pika Lane|  Fasidwu|   ID|84200| Tablet|   RED|
  17. | 10|      Ora|    Green|   20|Hevhit Extension|  Gounnob|   NJ|23654| Tablet| WHITE|
  18. | 11|   Amelia|  Gardner|   35|       Veko View|  Jiwpihe|   NH|14911| Tablet| WHITE|
  19. | 12|  Barbara| Sullivan|   28|     Zinkun Lane|  Licsuso|   LA|93342|   Misc| GREEN|
  20. | 13|  Timothy|   Butler|   22|        Ibir Key| Mamimasi|   SD|28341|   Misc|   RED|
  21. | 14| Winifred|    Greer|   38|     Maofo Plaza| Wutrapja|   NV|14020| Tablet| GREEN|
  22. | 15| Mathilda|  McGuire|   44|      Pomrij Key| Ukijajis|   WA|75335| Tablet|YELLOW|
  23. | 16|    Roger|  Jackson|   33|     Zeglaf Loop| Ahwajnes|   FL|05185|Desktop|YELLOW|
  24. | 17|    Allen|   Norris|   43|      Wenul Pike|  Suparot|   PA|65574|   Misc|  BLUE|
  25. | 18|    Lloyd|  Coleman|   63|       Cuah Lane|Pigpilmal|   WA|23346| Tablet| GREEN|
  26. | 19|  Barbara|   Powell|   20|      Izvo Grove| Itauvtes|   OH|55071|   Misc|YELLOW|
  27. | 20|   Hattie|  Douglas|   33| Ilaide Turnpike| Bijilrol|   HI|51512|   Misc| GREEN|
  28. +---+---------+---------+-----+----------------+---------+-----+-----+-------+------+*/
  29.  
  30.  
  31. //Version2
  32.  
  33.   val timeTravelDF_2 = Spark.read.format("delta").option("versionAsOf", 1).load("/delta-table/product")
  34.   timeTravelDF_2.show()
  35.  
  36.   /*+---+---------+---------+-----+----------------+---------+-----+-----+-------+------+-------+
  37. | id|firstName| lastName|house|          street|     city|state|  zip|   prod|   tag|Country|
  38. +---+---------+---------+-----+----------------+---------+-----+-----+-------+------+-------+
  39. |  1|  Micheal|   Adkins|   19|    Ofuca Avenue| Kopewevi|   PA|77774|   Misc| GREEN|  India|
  40. |  2|   Rachel|    Parks|   19|     Itmer Manor| Wejitcan|   AR|64675|Desktop|YELLOW|  India|
  41. |  3|   Julian|    Olson|   47| Pewih Boulevard| Lithejev|   NH|27953|Desktop|  BLUE|  India|
  42. |  4|     Carl|  Kennedy|   62|  Pekibu Highway| Jerhivme|   WV|51677|   Misc|  BLUE|  India|
  43. |  5|     Earl|Armstrong|   47|  Rejo Extension| Febugiro|   MO|05472| Laptop|YELLOW|  India|
  44. |  6|    Della|Armstrong|   25|    Febro Street| Wivgufiv|   MD|28380|Desktop|  BLUE|  India|
  45. |  7|   Milton|   George|   44|    Febos Circle|  Nuwacof|   MO|58670| Laptop|   RED|  India|
  46. |  8|  Jeffery|   Hughes|   39|      Zivve Park|  Dirhako|   NJ|03544|  Phone|   RED|  India|
  47. |  9|     Lura|   Thomas|   21|       Pika Lane|  Fasidwu|   ID|84200| Tablet|   RED|  India|
  48. | 10|      Ora|    Green|   20|Hevhit Extension|  Gounnob|   NJ|23654| Tablet| WHITE|  India|
  49. | 11|   Amelia|  Gardner|   35|       Veko View|  Jiwpihe|   NH|14911| Tablet| WHITE|  India|
  50. | 12|  Barbara| Sullivan|   28|     Zinkun Lane|  Licsuso|   LA|93342|   Misc| GREEN|  India|
  51. | 13|  Timothy|   Butler|   22|        Ibir Key| Mamimasi|   SD|28341|   Misc|   RED|  India|
  52. | 14| Winifred|    Greer|   38|     Maofo Plaza| Wutrapja|   NV|14020| Tablet| GREEN|  India|
  53. | 15| Mathilda|  McGuire|   44|      Pomrij Key| Ukijajis|   WA|75335| Tablet|YELLOW|  India|
  54. | 16|    Roger|  Jackson|   33|     Zeglaf Loop| Ahwajnes|   FL|05185|Desktop|YELLOW|  India|
  55. | 17|    Allen|   Norris|   43|      Wenul Pike|  Suparot|   PA|65574|   Misc|  BLUE|  India|
  56. | 18|    Lloyd|  Coleman|   63|       Cuah Lane|Pigpilmal|   WA|23346| Tablet| GREEN|  India|
  57. | 19|  Barbara|   Powell|   20|      Izvo Grove| Itauvtes|   OH|55071|   Misc|YELLOW|  India|
  58. | 20|   Hattie|  Douglas|   33| Ilaide Turnpike| Bijilrol|   HI|51512|   Misc| GREEN|  India|
  59. +---+---------+---------+-----+----------------+---------+-----+-----+-------+------+-------+*/
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top