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
4
votes
1 answer

Aligning number of elements in partition in Java Apache Spark

I have two JavaRDD called rdd1 and rdd2 over which I'd like to evaluate some correlation, e.g. with Statistics.corr(). The two RDDs are generated with many transformations and actions, but at the end of the process, they both have the same…
McKracken
  • 389
  • 4
  • 17
4
votes
1 answer

Scala partition a set

I was looking at how to split a set in two based on the contents of a third set. Accidentally I stumbled upon this solution: val s = Set(1,2,3) val s2 = Set(4,5,6) val s3 = s ++ s2 s3.partition(s) res0:…
zaxme
  • 1,065
  • 11
  • 29
4
votes
2 answers

Divide two rows over Partition

I have a table like this : Id Sym sum_amount pair 11 2 1000 1 11 3 500 1 22 4 200 2 22 4 50 2 And I would like to divide one value in a pair in the second in the same pair over partition by Id, Sym. and get…
Jordan1200
  • 478
  • 1
  • 5
  • 20
4
votes
2 answers

Cassandra split brain partition

We are running a 6-node cassandra cluster across two AWS availability zones (ap-southeast-1 and ap-southeast-2). After running happily for several months, the cluster was given a rolling restart to fix a hung repair, and now each group thinks the…
Adam Wells
  • 61
  • 1
  • 4
4
votes
1 answer

Select min/max from group defined by one column as subgroup of another - SQL, HPVertica

I'm trying to find the min and max date within a subgroup of another group. Here's example 'data' ID Type Date 1 A 7/1/2015 1 B 1/1/2015 1 A 8/5/2014 22 B 3/1/2015 22 B 9/1/2014 333 A 8/1/2015 333 B …
Megan
  • 43
  • 4
4
votes
3 answers

SparkSQL PostgresQL Dataframe partitions

I have a very simple setup of SparkSQL connecting to a Postgres DB and I'm trying to get a DataFrame from a table, the Dataframe with a number X of partitions (lets say 2). The code would be the following: Map options = new…
Moises B.
  • 637
  • 1
  • 8
  • 19
4
votes
2 answers

Why does Python's str.partition return the separator?

I use Python's str.partition in my code in three ways: before, __, after = string.partition(sep) before = string.partition(sep)[0] after = string.partition(sep)[2] While I use str.partition frequently, I've always wondered why it returns the…
Torsten Bronger
  • 9,899
  • 7
  • 34
  • 41
4
votes
4 answers

python - split a list in pairs and unique elements

I'm having a hard time trying to achieve the following: I have a list (say, [a,b,c,d]) and I need to partition it into pairs and unique elements in every possible way (order is not important), i.e.: [a,b,c,d], [(a,b), c,d], [(a,b), (c,d)], [a,…
Pablo
  • 613
  • 7
  • 11
4
votes
1 answer

Ext2 File system Block bitmap

I was reading Ext2 file system details, and I am not clear with the fact that the number of blocks in a block group is (b x 8) where b is the block size. How have they arrived at this figure. What is the significance of 8.
RootPhoenix
  • 1,626
  • 1
  • 22
  • 40
4
votes
2 answers

Recursive function counting and printing partitions of 1 to n-1

I am trying write a recursive function(it must be recursive) to print out the partitions and number of partitions for 1 to n-1. For example, 4 combinations that sum to 4: 1 1 1 1 1 1 2 1 3 2 2 I am just having much trouble with the function. This…
4
votes
2 answers

Rank by groups sql server

The problem seems simple but I can't get my head around it, this is for sql server what I have in a table : What I need as a output . cksum id cksum id -2162514679 204 …
Flying Turtle
  • 366
  • 7
  • 20
4
votes
2 answers

Oracle how to delete from a table except few partitions data

I have a big table with lot of data partitioned into multiple partitions. I want to keep a few partitions as they are but delete the rest of the data from the table. I tried searching for a similar question and couldn't find it in stackoverflow.…
Bolimera Hannah
  • 195
  • 1
  • 2
  • 11
4
votes
2 answers

C randomized pivot quicksort (improving the partition function)

I'm a computer science student (just started), I was working on writing from pseudocode a randomized pivot version of Quicksort. I've written and tested it, and it all works perfectly however... The partition part looks a bit too complicated, as it…
user3236524
  • 41
  • 1
  • 1
  • 2
4
votes
1 answer

MYSQL Partition avoid full scan table

Back ground: I have 8 million records and i want to speed up the Query time this is my table CREATE TABLE vehiclelog3 ( ID INT(100) NOT NULL AUTO_INCREMENT, `PNumber` VARCHAR(30) DEFAULT NULL, `Date` DATE DEFAULT NULL, `Time` TIME…
zero
  • 95
  • 1
  • 8
3
votes
4 answers

Is there a function to create a new column over two columns?

I have the following reservation…
Supafly
  • 57
  • 3