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
55
votes
4 answers

Oracle 'Partition By' and 'Row_Number' keyword

I have a SQL query written by someone else and I'm trying to figure out what it does. Can someone please explain what the Partition By and Row_Number keywords does here and give a simple example of it in action, as well as why one would want to use…
HashimR
  • 3,803
  • 8
  • 32
  • 49
38
votes
2 answers

How spark read a large file (petabyte) when file can not be fit in spark's main memory

What will happen for large files in these cases? 1) Spark gets a location from NameNode for data . Will Spark stop in this same time because data size is too long as per information from NameNode? 2) Spark do partition of data as per datanode block…
Arpit Rai
  • 391
  • 1
  • 4
  • 5
23
votes
3 answers

Device vs Partition vs File System vs Volume: how do these concepts relate to each other, accurately

How do these concepts relate to each other, from a Java developer standpoint? My question: Could someone provide explanations or some links for simple and accurate / generally accepted definitions? Tks. for reference, documents I found but are not…
mins
  • 6,478
  • 12
  • 56
  • 75
22
votes
2 answers

How can I identify partitions of an Android device from the shell?

I'm trying to find which partition is used for what, e.g. /boot, /recovery, /system, from adb shell. While this is trivial for partitions currently mounted (using the mount or df commands, see e.g. how to identify names of the partitions), this…
Izzy
  • 1,364
  • 3
  • 32
  • 65
21
votes
4 answers

MySQL table partition by month

I have a huge table that stores many tracked events, such as a user click. The table is already in the 10s of millions, and it's growing larger every day. The queries are starting to get slower when I try to fetch events from a large timeframe, and…
shaharmor
  • 1,636
  • 3
  • 14
  • 26
20
votes
2 answers

Add PARTITION after creating TABLE in hive

i have created a non partitioned table and load data into the table,now i want to add a PARTITION on the basis of department into that table,can I do this? If I do: ALTER TABLE Student ADD PARTITION (dept='CSE') location '/test'; It gives me…
rinku buragohain
  • 329
  • 2
  • 7
  • 15
19
votes
2 answers

How to view information of partitions in a table?

How can I view partition details of a table, like how many partitions are there in a table and storage size of each partition?
Ben
  • 379
  • 1
  • 5
  • 14
17
votes
3 answers

How to paginate a list of objects in Java 8?

Given a java.util.List with n elements and a desired page size m, I want to transform it to a map containing n/m+n%m elements. Each map element shall contain m elements. Here's an example with integers: List list = Arrays.asList(1, 2,…
adragomir
  • 457
  • 4
  • 16
  • 33
16
votes
1 answer

consumer.How to specify partition to read? [kafka]

I am learning Kafka and I want to know how to specify then partition when I consume messages from a topic. I have found several pictures like this: It means that a consumer can consume messages from several partitions but a partition can only be…
gstackoverflow
  • 36,709
  • 117
  • 359
  • 710
15
votes
2 answers

Python partition and split

I want to split a string with two words like "word1 word2" using split and partition and print (using a for) the words separately like: Partition: word1 word2 Split: word1 word2 This is my code: print("Hello World") name = raw_input("Type your…
Marcos Guimaraes
  • 1,243
  • 4
  • 27
  • 50
14
votes
1 answer

Spark: Repartition strategy after reading text file

I have launched my cluster this way: /usr/lib/spark/bin/spark-submit --class MyClass --master yarn-cluster--num-executors 3 --driver-memory 10g --executor-memory 10g --executor-cores 4 /path/to/jar.jar The first thing I do is read a big text file,…
Stephane Maarek
  • 5,202
  • 9
  • 46
  • 87
13
votes
1 answer

Changing a partition with fdisk shows a warning like "partition#x contains ext4-signature"

I'm shrinking a partion size with #Reduce Partition Size fsck -f /dev/sdb2 resize2fs /dev/sdb2 -M -p #Limit Partion fdisk /dev/sdb ... #Now I'm changing the Partition 2 to the new (smaller) size fdisk gives me a (red) warning like partition#2…
powerpete
  • 2,663
  • 2
  • 23
  • 49
13
votes
8 answers

All ways to partition a string

I'm trying to find a efficient algorithm to get all ways to partition a string eg for a given string 'abcd' => 'a' 'bcd' 'a' 'b' 'cd' 'a' 'b' 'c' 'd' 'ab' 'cd' 'ab' 'c' 'd' 'abc' 'd' 'a', 'bc', 'd any language would be appreciated Thanks in…
Ben
  • 268
  • 1
  • 2
  • 7
13
votes
1 answer

Spark: persist and repartition order

I have the following code: val data = input.map{... }.persist(StorageLevel.MEMORY_ONLY_SER).repartition(2000) I am wondering what's the difference if I do the repartition first like: val data = input.map{...…
Edamame
  • 23,718
  • 73
  • 186
  • 320
12
votes
2 answers

How do I alter my existing table to create a range partition in Oracle

I have existing table which has 10 years of data (I have taken dump). I would like to Range partition the existing table on one date key column within the table. Most of the examples I see are with CREATE TABLE..PARTITION BY RANGE... to add new…
Some Java Guy
  • 4,992
  • 19
  • 71
  • 108
1
2 3
99 100