Skip to content

Instantly share code, notes, and snippets.

@nfarah86
Created October 21, 2021 23:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nfarah86/3106414ad13bd9c45d3245f27f51b19a to your computer and use it in GitHub Desktop.
Save nfarah86/3106414ad13bd9c45d3245f27f51b19a to your computer and use it in GitHub Desktop.
def create_collection(rs):
# need to do: create an integration on the Rockset console
# Below: After, we can create a collection from the integration
integration = rs.Integration.retrieve('s3spark-rockset')
csv = rs.Source.csv_params(
separator=',',
encoding='UTF-8',
first_line_as_column_names=True,
column_names=None,
column_types=None
)
s3 = rs.Source.s3(bucket='spark-rockset-public-nadine', prefix='OutputMovies.csv/', integration=integration, format_params=csv)
newcoll = rs.Collection.create(name='s3sparkPythonMoviesColTrue', sources=[s3])
# note we would want to poll the collection until it's `READY`
return rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment