@@ -162,6 +162,38 @@ def test_copy_into_table_sub_select_column_clauses(self):
162162 checkparams = {"1_1" : "xyz" , "IF_1" : "NULL" , "IF_2" : "NOTNULL" },
163163 )
164164
165+ def test_copy_into_table_files (self ):
166+ m = MetaData ()
167+ tbl = Table (
168+ "atable" ,
169+ m ,
170+ Column ("id" , Integer ),
171+ schema = "test_schema" ,
172+ )
173+
174+ copy_into = CopyIntoTable (
175+ target = tbl ,
176+ from_ = GoogleCloudStorage (
177+ uri = "gcs://some-bucket/a/path/to/files" ,
178+ credentials = "XYZ" ,
179+ ),
180+ files = ['one' ,'two' ,'three' ],
181+ file_format = CSVFormat (),
182+ )
183+
184+ self .assert_compile (
185+ copy_into ,
186+ (
187+ "COPY INTO test_schema.atable"
188+ " FROM 'gcs://some-bucket/a/path/to/files' "
189+ "CONNECTION = ("
190+ " ENDPOINT_URL = 'https://storage.googleapis.com' "
191+ " CREDENTIAL = 'XYZ' "
192+ ") FILES = ('one', 'two', 'three')"
193+ " FILE_FORMAT = (TYPE = CSV)"
194+ ),
195+ )
196+
165197
166198class CopyIntoResultTest (fixtures .TablesTest ):
167199 run_create_tables = "each"
@@ -204,7 +236,7 @@ def test_copy_into_stage_and_table(self, connection):
204236 eq_ (r .rowcount , 1000 )
205237 copy_into_results = r .context .copy_into_location_results ()
206238 eq_ (copy_into_results ['rows_unloaded' ], 1000 )
207- eq_ (copy_into_results ['input_bytes' ], 16250 )
239+ # eq_(copy_into_results['input_bytes'], 16250) # input bytes will differ, the table is random
208240 # eq_(copy_into_results['output_bytes'], 4701) # output bytes differs
209241
210242 # now copy into table
0 commit comments