Open hai1y1kr opened 2 years ago
What's your query? My returns correctly in cursor.description
What's your query? My returns correctly in cursor.description This is my function,and all the cursor.description is None for different querys. def read_table(self, sql_sentence= r'show tables'): if self.is_connected(): logger.debug('='*40) logger.debug('Executing: ' + sql_sentence) start_time = time.time() try: if self.plantform == 'presto': sentence_1 = 'set session hive.parquet_fail_with_corrupted_statistics = false' self.cursor.execute(sentence_1) self.cursor.fetchall() self.cursor.execute(sql_sentence) self.con.commit() col_names = self.cursor.description rows = self.cursor.fetchall() logger.info('Got rows: ' + str(len(rows)) + ' time consumed: ' + str(time.time() - start_time)) except Exception as e: logger.error('read table failed: ' + str(e)) return rows, col_names else: logger.warn('warning: disconnected')
cursor.description return None