Created
October 21, 2021 23:22
-
-
Save nfarah86/3106414ad13bd9c45d3245f27f51b19a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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