485 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
0
answers
71
views
Inserting into text array column when using unnest() [duplicate]
I have a table with the follow definition:
CREATE TABLE "test" (
id UUID PRIMARY KEY,
created TIMESTAMPTZ NOT NULL,
description TEXT,
permissions TEXT[]
);
I want to bulk ...
2
votes
2
answers
199
views
Unnest a complex and inconsistent dataset using data.table
I have a dataset that originally was a json file which is converted to a data.table with data.table(jsonlite::fromJSON(data)). The resulting data.table is complex with nested data containing not only ...
3
votes
4
answers
245
views
Fast unnest complex column with data.table
I have a dataset where the column to unnest contains data with unequal rows and columns rather than data with equal dimensions. I'm looking for a fast approach to unnest this dataset using data.table.
...
0
votes
0
answers
43
views
Error using Postgres PostGIS unnest function with list of WKT strings using SpringBoot repo
My spring boot query looks like this:
@Query(value = "WITH input_points AS (SELECT ST_GeomFromText(unnest(:locations), :srid) AS geom)" +
"SELECT ST_AsText(ip.geom) AS point_wkt FROM ...
0
votes
1
answer
87
views
How to flatten nested JSON with Jolt?
Hi I have following json and would like to unnest filed.So, I have an old order and new order for products. There could be more field to the json but level of nesting remains the same. Is it possible ...
2
votes
1
answer
55
views
How can I query attributes with struck array data type?
I have this value with data type array<struct<id:string,name:string,values:array<string>>
[
{id=gid://test/1234, name=Size, values=[L, M, S, XS]},
{id=gid://test/12345, name=...
0
votes
0
answers
73
views
postgresql - catch missing element when bulk inserting using unnest
I have a postgresql function, that takes multiple varchar arrays in input.
function my_function
(
p_attr1 in varchar[],
p_attr2 in varchar[],
...
0
votes
1
answer
71
views
how to unnest json string from data frame in R?
Hi and thanks for reading me. I have a data frame that have the next structure:
# A tibble: 6 ×ばつ 2
customerId transactionHistory ...
0
votes
2
answers
86
views
SQL join: unnesting rows with same column names (but different data) without resorting to aliases
Let's say I have three tables:
t1:
client_id
transmission_id
timestamp
column_A
1
AAA1
2024年10月16日 10:31:27
Banana
1
AAA2
2024年10月16日 11:31:27
Citrus
2
BBB1
2024年10月16日 09:12:14
Apple
t2:
client_id
...
1
vote
2
answers
675
views
Loading nested JSON
Trying to load a nested JSON file into Duckdb.
Here is the JSON contents:
{
"MainLevel":[
{
"More":{
}
},
{
"More":{
...
1
vote
1
answer
203
views
Unnest list column: In row 2, can't recycle input of size 2 to size 4
I'm encountering issues when attempting to unnest a dataframe containing list columns. The dataframe structure and the unnesting code I'm using are as follows:
library(dplyr)
library(tidyr)
df = ...
0
votes
1
answer
559
views
How to Efficiently Index and Search Arrays with UNNEST in PostgreSQL
I have a products table with an array column tags that contains up to 700 elements.
I want to efficiently search for specific tag names for a given user to be used in a search bar.
Here's my query:
...
3
votes
2
answers
273
views
Expand/Unnest Polars struct into rows, not into columns
I have this DataFrame
import polars as pl
df = pl.DataFrame({
'as_of': ['2024-08-01', '2024-08-02', '2024-08-03', '2024-08-04'],
'quantity': [{'A': 10, 'B': 5}, {'A': 11, 'B': 7}, {'A': 9, ...
1
vote
1
answer
168
views
Time Cost of UNNEST operation in query?
This is for PrestoSQL
Assuming col1, col2, col3 are of same cardinality, and assuming the Table has N rows
SELECT c1 from Table, UNNEST(col1) AS t(c1)
SELECT c1, c2 from Table, UNNEST(col1, col2) ...
1
vote
1
answer
44
views
Unnesting tibble after matrix multiplication
As simple example I want to calculate the matrix product of two vectors.
a <- tibble(n=c("A", "B"), y=c(10,20))
b <- tibble(x=c(5, 15))
res <- a %>%
mutate(rotated =...