I have multiple parquet files categorised by id something like this:
/user/desktop/id=1x/year=2020/month=8/day=12/file1.parquet
/user/desktop/id=2x/year=2020/month=8/day=15/file2.parquet
/user/desktop/id=3x/year=2020/month=9/day=11/file3.parquet
/user/desktop/id=4x/year=2020/month=8/day=22/file4.parquet
I have a python list which holds all the id value something like this:
id_list = ['1x','2x','3x']
I want to read all the files at once for ids present inside in id_list and also I want to read files which corresponds to month=8 So, for this example only file1 and file2 should be read.
I am doing like this:
sub_path = '/*/*/*/*.parquet'
input_df = sqlContext.read.parquet('/user/desktop/' + 'id={}'.format(*id_list) + sub_path)
This is picking only the file inside first id of the id_list which is id='1x'. Can anyone please help me what I am missing here?