unnest is a function from the tidyr package that can expand the list columns.
Questions tagged [unnest]
456 questions
0
votes
1 answer
Unnest lists of list from an elastic Search result in R
EDIT 1: the problem in more simple terms (for the whole issue, check the Original Edit)
How can I unlist a list of key, values pairs within a dataframe, knowing that the number of pairs may vary.
For instance:
_source.types …

Tau
- 173
- 1
- 8
0
votes
0 answers
POSTGRESQL - UNNEST function not work in LINUX
I got a duplicate row displayed. though I already added 'DISTINCT',When i run query duplicate records show.
id | product | service
---+-----------------------
1 |p1 |s1
2 |p2 |s2
3 |p2 |s2
SELECT DISTINCT…
user8918955
0
votes
1 answer
IN Linux Distinct SQL is not working with UNNEST
When i run this query in window system behave correctly UNNSET
but when i run this query Linux behave different.unnset duplicate record list on different row
SELECT DISTINCT
"billing_billmanagement"."creation_date",
…
user8918955
0
votes
1 answer
Unnest row in MS-Access?
Currently property block and lot information is entered into our ms-access database in separate input boxes which then populate a table. One box for block and one for lot. If an application contains one block but multiple lots then the user enters…

Krizzle
- 21
- 3
0
votes
2 answers
PostgresSql + Nodejs (ClaudiaJS) : How to cast array of string to array of timestamp
I am writing API which insert into a table with multiple rows, I am using UNNEST to make it work.
What I have done:
in js file:
api.post(PREFIX + '/class/insert', function (request) {
var db = pgp(dbconnect);
//Params
var data =…

Phong Vu
- 2,726
- 6
- 24
- 52
0
votes
2 answers
Unable to un-nest some fields using google bigquery (standard)
I have a nested table that I can not access all fields of using standard google bigquery.
For example this query fails
SELECT *
FROM
(
SELECT
rev_info.user.id as player_id,
rev_info.purchase.total.currency as…

user2998362
- 15
- 3
0
votes
1 answer
Unnest json file with coordinates into dataframe in R
I'm having trouble parsing a json file into a dataframe in R. I've been able to turn the json file into a data frame, but I can't seem to unnest the "geometry" column. Below is a sample of the json file
[
{
"point_id": 4,
"geometry": {
…

jsimpsno
- 448
- 4
- 19
0
votes
1 answer
unnest with psycopg2 throwing error
i have following python script to insert data into psql
from psycopg2 import connect
con = connect( """my string""")
query = """ INSERT INTO test.result_data
SELECT id,
result,
result1,
…

Kush Patel
- 3,685
- 5
- 42
- 65
0
votes
1 answer
Unable to extract key-value pairs from BigQuery table which has arrays and structs
I have integrated Firebase analytics data with google BigQuery and everyday a new table gets created with the DATE stamp.
one sample table is "projectID.com_dev_sambhav_ANDROID.app_events_20170821"
One sample table is shown below
sample table
My…

Debiprasad Mishra
- 111
- 1
- 12
0
votes
1 answer
Flat data of BigQuery table and copy the flatted data to a new BigQuery table
I'm new to BQ.
I have a table which some of the columns are record-repeated. I'm trying to flat the table, so it would be kind of relational, and to insert the flatted data into new BigQuery table.
Is it possible? How should I do it?

Shir Da.
- 13
- 1
0
votes
0 answers
MATLAB - Table - Unnest variable sized cells in table
I tried to unnest a variable sized cell in a table. I get dimension unmatch multiple tries. Here the code (German, just random names):
entwicklung = {{'Mueller', 'Schroeder', 'Kuehn'},...
{'Schulz', 'Wagner'}, ...
{'Wolf', 'Schwarz',…

MatseSo
- 1
- 2
0
votes
1 answer
Jooq notation for unnest with multiple arrays
I want to mix in external timezone per location info to filter rows that has timestamp without timezone values.
How can I express in Jooq this SQL (Postgresql) snippet
WITH
now(locaton, value) AS (
SELECT
*
FROM…

Alex Dvoretsky
- 938
- 9
- 21
0
votes
2 answers
Why when unnesting two or more variables in BigQuery do I get no results?
I'm looking at the particular actions of one visitor on our site just to gain an understanding of how some data is collected and how to pull the data that I need. Basically specific promotions are fired when a visitor sees certain sections of our…

Thomas Chamberlain
- 127
- 2
- 2
- 8
0
votes
1 answer
How to Insert into table using multiple row returned value from subquery?
How exactly do I get this to work? I am trying my best to form a query that takes the primary keys generated from the first query and then inserts them into the 2nd table along with a static 2nd value(33). I am obviously getting a "more than one row…

user3159860
- 11
- 2
0
votes
1 answer
How do you unnest an int4range to multiple rows in postgres 9.4?
Input:
select 'a string', unnest(int4range(98,104));
Current Output:
"ERROR: function unnest(int4range) does not exist"
Desired Output:
'a string', 98
'a string', 99
'a string', 100
'a string', 101
'a string', 102
'a string', 103

user2109431820398
- 37
- 7