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

Support for CREATE TYPE #15836

Open
Alibirb opened this issue Apr 12, 2024 · 5 comments
Open

Support for CREATE TYPE #15836

Alibirb opened this issue Apr 12, 2024 · 5 comments
Labels
needs concrete use-case needs upvotes Please use the reaction feature on the issue to signal your interest. This helps us prioritize

Comments

@Alibirb
Copy link

Alibirb commented Apr 12, 2024

CrateDB version

5.6.4

CrateDB setup information

No response

Problem description

I'm trying to replace postgres with CrateDB, but it seems CrateDB doesn't support creating types like postgres does, and our existing tables rely on a custom type.

Steps to Reproduce

CREATE TYPE sort_key AS (
    time timestamptz,
    ident text
);

Actual Result

no viable alternative at input 'CREATE TYPE'

Expected Result

Should create the type

@Alibirb Alibirb added the triage An issue that needs to be triaged by a maintainer label Apr 12, 2024
@seut
Copy link
Member

seut commented Apr 12, 2024

Wouldn't using an object typed column defined at the table definition a working alternate?

@Alibirb
Copy link
Author

Alibirb commented Apr 12, 2024

Wouldn't using an object typed column defined at the table definition a working alternate?

Maybe. I don't have much SQL knowledge so I don't know the implications.

But upon further investigation, it seems like this is far from the only postgres feature we use that CrateDB is missing. Docs say user defined functions are only supported in JavaScript (we define them in SQL), no support for creating rules, or triggers, or aggregates... I suspect these may be a bit harder to work around.

But given that the lack of support for CREATE TYPE isn't mentioned in the docs under "unsupported features and functions", I think this support should either be added, or the docs should be updated to acknowledge that it's missing.

@mfussenegger mfussenegger added needs upvotes Please use the reaction feature on the issue to signal your interest. This helps us prioritize needs concrete use-case and removed triage An issue that needs to be triaged by a maintainer labels Apr 15, 2024
@surister
Copy link
Contributor

surister commented Apr 16, 2024

CrateDB supports many aggregate functions, https://cratedb.com/docs/crate/reference/en/5.6/general/builtins/aggregation.html#aggregation Is there any that you are missing from Crate?

@Alibirb
Copy link
Author

Alibirb commented Apr 16, 2024

CrateDB supports many aggregate functions, https://cratedb.com/docs/crate/reference/en/5.6/general/builtins/aggregation.html#aggregation Is there any that you are missing from Crate?

I'm missing the ability to define my own aggregation functions.

@hlcianfagna
Copy link
Contributor

I'm missing the ability to define my own aggregation functions.

Hi, it is a workaround, but you may want to take a look at how this is achieved with an UDF in https://community.cratedb.com/t/advanced-downsampling-with-the-lttb-algorithm/1287

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs concrete use-case needs upvotes Please use the reaction feature on the issue to signal your interest. This helps us prioritize
Projects
None yet
Development

No branches or pull requests

5 participants