concept county in category spark

This is an excerpt from Manning's book Spark in Action, Second Edition.
Your first dataset comes from Wake County in North Carolina at http://mng.bz/ 5AM7 . It contains a list of restaurants in the county. The data can be downloaded directly from http://mng.bz/Jz2P .
Similarly, to extract the county’s
id, you can retrieve the modulo (rest of the division) by 1,000:.withColumn( "countyId" , expr( "id%1000" ))Listing 12.3 continues building the intermediate dataframe, by extracting the
countyStatearray’s elements. Therefore, your dataset will not have nested elements but only linearized data to build, like a basic table. You see that the county (or parish in Louisiana) is the first (index 0) element of thecountyStatearray, and the state is the second (index of 1) element in the same array.