Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNOW-343335: Why is get_columns() implemented as a select from information schema instead of more performant describe #221

Closed
bastienboutonnet opened this issue Apr 14, 2021 · 1 comment
Labels

Comments

@bastienboutonnet
Copy link

bastienboutonnet commented Apr 14, 2021

I am curious as to why get_columns() implements using a select query from the info schema (

def _get_table_columns(self, connection, table_name, schema=None, **kw):
) while describe table would get us the same kind of info.

I see that at some point in the past your implementation was using describe (https://github.com/snowflakedb/snowflake-sqlalchemy/pull/33/files#diff-8a3053a35fc794b288420f7343bfbc575c18bc834c223c2aae201e0adcfdd5c0R455) so I am curious what is the reason why this was changed.

It seems like this issue also talks about a related topic: #204 but there doesn't seem to be any resolution or conclusion on it.

I am asking because I personally would like to use describe instead and therefore re-implement get_columns() but I'd rather check with you if I am missing something and the reason why you resort to an ultimately less performant implementation.

The questions below are irrelevant for this issue*

Please answer these questions before submitting your issue. Thanks!

  1. What version of Python are you using (python --version)?

  2. What operating system and processor architecture are you using (python -c 'import platform; print(platform.platform())')?

  3. What are the component versions in the environment (pip list)?

  4. What did you do?
    If possible, provide a recipe for reproducing the error.
    A complete runnable program is good.

  5. What did you expect to see?

  6. What did you see instead?

  7. Can you set logging to DEBUG and collect the logs?

import logging
import os

for logger_name in ['snowflake.sqlalchemy', 'snowflake.connector', 'botocore']: 
    logger = logging.getLogger(logger_name)
    logger.setLevel(logging.DEBUG)
    ch = logging.StreamHandler()
    ch.setLevel(logging.DEBUG)
    ch.setFormatter(logging.Formatter('%(asctime)s - %(threadName)s %(filename)s:%(lineno)d - %(funcName)s() - %(levelname)s - %(message)s'))
    logger.addHandler(ch)
@github-actions github-actions bot changed the title Why is get_columns() implemented as a select from information schema instead of more performant describe SNOW-343335: Why is get_columns() implemented as a select from information schema instead of more performant describe Apr 14, 2021
@github-actions github-actions bot added the Stale label Apr 5, 2023
@github-actions
Copy link

github-actions bot commented Apr 5, 2023

To clean up and re-prioritize bugs and feature requests we are closing all issues older than 6 months as of Apr 1, 2023. If there are any issues or feature requests that you would like us to address, please re-create them. For urgent issues, opening a support case with this link Snowflake Community is the fastest way to get a response

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant