Questions tagged [partition]

Use this tag for questions about code that partitions data, memory, virtual machines, databases or disks.

In computing, partition may refer to

  • Disk partitioning, the division of a hard disk drive
  • Partition (database), the division of a database
  • Logical partition (virtual computing platform) (LPAR), a subset of a computer's resources, virtualized as a separate computer
  • Memory partition, a subdivision of a computer's memory, usually for use by a single job
  • Binary space partitioning

source: https://en.wikipedia.org/wiki/Partition

Note that non-programming questions about database partitioning are likely to be better received on Database Administrators and disk partitioning on Server Fault.

1547 questions
-1
votes
1 answer

Snowflake partitioning

I have records like below: login_id login_type login_name login_timestamp page_id 1 event null 2023-01-13 00:22:02.560 1 1 event null 2023-01-13 00:22:02.634 1 1 page login 2023-01-13 00:22:02.882 1 1 event login 2023-01-13…
VarYaz
  • 119
  • 2
  • 12
-1
votes
1 answer

Partition Over issue in SQL

I have a Order shipment table like below - Order_ID shipment_id pkg_weight 1 101 5 1 101 5 1 101 5 1 102 3 1 102 3 I want the output table to look like below…
-1
votes
1 answer

Partition Insertion Issue while inserting data

I have table ABC in Oracle which has partition b100 and b200 which holds data like 100 and 200 accordingly. When we try to insert data apart from these Oracle developer throws an error. Now when we try to implement the same thing in SQL SERVER, the…
-1
votes
1 answer

PostgreSQL: Count common values of column B between ids of column A

I would like to count the common friends between users. However, I'm struggling in coming with an approach as the users are in the same column. Imagine the following dummy tables: with users (user_id, user_name) as (values (7,' Adam'), (5,'…
Joehat
  • 979
  • 1
  • 9
  • 36
-1
votes
1 answer

Creating a filesystem in C

I want to create a ext4 filesystem in C For example, my C code currently runs system("mkfs.ext4 /dev/sdc1") The problem is using system is not recommended and we don't want to have mkfs.ext4 utility in the root file system. I saw mke2fs.c file in…
md.jamal
  • 4,067
  • 8
  • 45
  • 108
-1
votes
1 answer

does df.write.csv create number of partitions equals to total no of records in the df?

add_dist.write.format("csv").option("sep",",").mode("overwrite").save("C:\BigData\projects\datalake\address_op") i am trying to write into the folder in csv format using pyspark. Dataframe has 25 total records and it is creating 25…
-1
votes
1 answer

Partitioning using multiple fields and getting the same group number per partitioned group

I have a data set that looks like below: CarType Date Car Honda 5/28/2022 car1 Honda 5/28/2022 car1 Honda 8/11/2022 car2 Honda 8/11/2022 car2 BMW 5/28/2022 car1 BMW 5/28/2022 car1 BMW 8/11/2022 car2 BMW 8/11/2022 car2 I…
genie
  • 195
  • 1
  • 2
  • 11
-1
votes
1 answer

Mysql last_value window function on a datetime column

Below is the data set I am working with: customer_id, event_date, status, credit_limit 1, 2019-1-1, C, 1000 1, 2019-1-5, F, …
sotn
  • 1,833
  • 5
  • 35
  • 65
-1
votes
1 answer

How to recreate a rootfs with an .ext4 file

I have an embedded device with an emmc and a qspi-flash, both of which have an operating system on them. From the OS running in the qspi-flash, I have a rootFS.ext4 file, the entire root filesystem for the OS on the emmc. From the qspi, I can see…
alexv9
  • 126
  • 1
  • 9
-1
votes
1 answer

How do I get all possible set partition of a list with maximum size limit of each subset?

Here is what I am trying to do. Given a number k and a set of numbers, I want to partition the set with elements of size not bigger than k. Ex) lst = [1, 2, 3, 4], k=2 All possible set partition of lst is as follows. codes are in previous question…
-1
votes
1 answer

Why the number of partitions is decided by a splitsize of 32MB?

I have an input file of 849MB. When I read this file in pyspark shell using sc.textFile() and check the no. of partitions, it is 27. I have another file of size 2.60GB and for this file the no. of partitions is 84. It seems that value of…
-1
votes
2 answers

SQL - check if a date is within 14d in another column and return the most recent date

I have a data set that has the following columns: user_id, A_view_dt, A_conversion_dt B_view_dt. I wanted to check If A_conversion_dt IS NOT NULL, then see if there's another record in B_view_dt that belongs to the same user_id happened 14d prior…
-1
votes
1 answer

Partition a Linked List (C)

The problem asks us to split a Linked List based on a pivot value (1->2->4->6->3->5 pivot = 5 ) => ( 1->2->4->3->5->6) My Solution to the problem was to create 3 new linked list and split based on the pivot value. However I am not able to…
-1
votes
2 answers

How to get aggregate as a percentage of the total

I have a table: CREATE TABLE schools ( ID int, type varchar(255) ); INSERT INTO schools (ID, type) VALUES (1, NULL), (2, 'primary'), (3, 'secondary'), (4, 's'), (5, 'p'), (5,…
Jade
  • 25
  • 5
-1
votes
2 answers

Implement SQL query with conditional sum and how does it work?

I am trying to write the SQL to generate the count of unique users who have purchased product B but have never purchased product C. user_id product date_purchased 1 A 2015-01-10 00:00:00.000 1 B 2014-11-23 00:00:00.000 1 C 2015-05-01…