Comments (6)
Seems to be an issue with determining scale
SELECT
txt,
SUM(val) AS val,
SUM(val :: NUMERIC(10, 2)) AS val2
FROM
t01
GROUP BY
txt;
+-----+-----+------+
| txt | val | val2 |
+-----+-----+------+
| a | 1.0 | 100 |
+-----+-----+------+
+-----+-----+------+
| txt | val | val2 |
+-----+-----+------+
| a | 1.0 | 1.0 |
+-----+-----+------+
from crate.
Fails systematically with:
@Test
public void test_numeric_agg() {
execute("CREATE TABLE IF NOT EXISTS t01 (txt TEXT, val DOUBLE PRECISION)");
execute("INSERT INTO t01 VALUES ('a', 1.0), ('a', null)");
execute("REFRESH TABLE t01");
execute(
"""
SELECT
txt,
SUM(val) AS val,
SUM(val :: NUMERIC(10, 2)) AS val2
FROM t01
GROUP BY txt
""");
assertThat(response).hasRows(
"a| 1.0| 1.0"
);
}
and minimum 2 data nodes. you can annotate the test class with:
@IntegTestCase.ClusterScope(numDataNodes = 2, supportsDedicatedMasters = false, numClientNodes = 0)
from crate.
The assertion needs to be:
assertThat(response).hasRows(
"a| 1.0| 1.00"
);
at which point the test fails 50% of the time. Changing the insert statement to add a single document, INSERT INTO t01 VALUES ('a', 1.0)
, also makes no difference. So it looks as though this is explicitly something to do with how the cast statement gets moved around between nodes.
from crate.
Yep, from a quick debug, I saw that NumericType is streamed with null scale and precision, so the write/read value doesn't work correctly afterwards.
from crate.
I think the bug is somewhere in SignatureBinder
- even if a type with parameters gets passed in to bind()
then the output BoundSignature
has no parameters on its return type.
from crate.
Thanks a lot for reporting @proddata! This issue has been fixed and will be available with the next hotfix release
from crate.
Related Issues (20)
- dev cluster hash join regression HOT 1
- JWT: support public keys caching HOT 3
- Architecture image not readable in dark mode HOT 1
- fdw/jdbc: Support and document adding additional jdbc drivers
- Improve insert performance for partitioned tables HOT 2
- max_shards_per_node not behaving as documented HOT 5
- Improve SQLParseException to include query and approximate position of the error. HOT 2
- COPY FROM does not work on all files inside folder HOT 10
- Vector Store: Provide distance functions as scalar functions HOT 3
- Support for CREATE TYPE HOT 5
- Unable to copy data between tables using the syntax: `INSERT INTO test2 (SELECT * FROM test)` HOT 5
- Docker image for 5.5.4 unavailable HOT 3
- Prepared Statements Incorrectly Storing Partition Information HOT 5
- Allow non-superusers to run ALTER TABLE REROUTE commands HOT 5
- ArrayIndexOutOfBoundsException in complex query HOT 3
- Disallow setting both balance.index and balance.shard factors to 0
- Improve primary shards balancing/reduce primary shard write overhead HOT 1
- Support `GROUP BY ALL` HOT 9
- Avoid adding unreleased file in EOL branches (maybe we need a custom plugin?) HOT 2
- Support Parquet as export file format for `COPY TO` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crate.