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-1006168: Snowpark function array_agg converts data types to string #1199

Open
FlorianWilhelm opened this issue Jan 11, 2024 · 1 comment
Assignees
Labels
bug Something isn't working feature New feature or request needs triage Initial RCA is required

Comments

@FlorianWilhelm
Copy link

Please answer these questions before submitting your issue. Thanks!

  1. What version of Python are you using?

    Snowsight Python notebook with snowflake-snowpark-python 1.11.1

  2. What operating system and processor architecture are you using?

    Snowsight Python notebook with snowflake-snowpark-python 1.11.1

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

    Snowsight Python notebook with snowflake-snowpark-python 1.11.1

  4. What did you do?

I used the function array_agg and a column of big ints.

import snowflake.snowpark as snowpark
from snowflake.snowpark.functions import col, array_agg

def main(session: snowpark.Session): 
   df = session.create_dataframe([[1], [2], [3], [1]], schema=["a"])
   print("Initial dtypes:", df.dtypes)
   df = df.select(array_agg("a", False).alias("result"))
   print("After array_agg dtypes:", df.dtypes) 
   return df
  1. What did you expect to see?

    I hoped to get a single row and a column with dtype array<bigint>. Instead I got array<string>.

The PY output when runing the code above is:

Initial dtypes: [('A', 'bigint')]
After array_agg dtypes: [('RESULT', 'array<string>')]

Why array<string>, this is crazy, but here is my number! as string? 🎤

@FlorianWilhelm FlorianWilhelm added bug Something isn't working needs triage Initial RCA is required labels Jan 11, 2024
@github-actions github-actions bot changed the title Snowpark function array_agg converts data types to string SNOW-1006168: Snowpark function array_agg converts data types to string Jan 11, 2024
@sfc-gh-yixie
Copy link
Collaborator

Yes we now use json string for arrays. A feature is under development for typed arrays.

@sfc-gh-ashahi sfc-gh-ashahi self-assigned this Mar 13, 2024
@sfc-gh-ashahi sfc-gh-ashahi added the feature New feature or request label Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature New feature or request needs triage Initial RCA is required
Projects
None yet
Development

No branches or pull requests

3 participants