Skip to content

Commit

Permalink
AND query pushdown for EXCEL and ODF
Browse files Browse the repository at this point in the history
  • Loading branch information
ergo70 committed Feb 13, 2020
1 parent b4c75dc commit 59aea77
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cloudfs_fdw/cloudfs_fdw.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,12 @@ def _render_excel_or_odf(self, data_stream, quals, sortkeys):
for qual in quals:
column_type = self.columns[qual.field_name].base_type_name
column_index = column_names.index(qual.field_name)
query += df_columns[column_index] + ('==' if qual.operator == '=' else qual.operator) + (
('"' + str(qual.value) + '"') if column_type in ['text', 'varchar', 'character varying', 'char', 'character'] else str(qual.value)) + ' and '
if qual.operator in ['<', '<=', '=', '>', '>=']:
query += df_columns[column_index] + ('==' if qual.operator == '=' else qual.operator) + (
('"' + str(qual.value) + '"') if column_type in ['text', 'varchar', 'character varying', 'char', 'character'] else str(qual.value)) + ' and '

object_stream.query(expr=query[:-5], inplace=True)
if query:
object_stream.query(expr=query[:-5], inplace=True)

if sortkeys and len(object_stream.index) > 1:
sort_columns = []
Expand Down

0 comments on commit 59aea77

Please sign in to comment.