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

TSQL Partition by with Order by

I noticed that when I use a partition by like below SELECT ROW_NUMBER() OVER(PARTITION BY categoryid ORDER BY unitprice, productid) AS rownum, categoryid, productid, productname, unitprice FROM Production.Products; the result set returned to me…
TheWommies
  • 4,922
  • 11
  • 61
  • 79
5
votes
2 answers

How to query on AWS Athena partitioned table

Summary of the Question When I attempts to SELECT query the partitioned table with WHERE clause, Athena produce an error. There are 4 types of partitions, in my log table. year string month string day string hour string I tried SELECT query on…
MOON BLUE
  • 53
  • 1
  • 5
5
votes
2 answers

Partitions not in metastore ERROR on Athena

I'm trying to partition data by a column. However, when I run the the query MSCK REPAIR TABLE mytable, it returns error Partitions not in metastore: city:countrycode=AFG city:countrycode=AGO city:countrycode=AIA city:countrycode=ALB …
Nhiên Ngô Đình
  • 544
  • 2
  • 6
  • 16
5
votes
1 answer

What are the allowed data types of partition column in hive?

I am pretty sure that complex types like STRUCT can not be the type of a partition column. But I am not sure if all the primitive types are valid or not. I have read a lot of documentation but didn't find anything.
Wang Zhong
  • 125
  • 2
  • 9
5
votes
0 answers

APFS Container Resize error code is 49187

When I try to create/resize partition via Disk Utility or Terminal I get an error: APFS Container Resize error code is 49187 Also I stopped Time Machine, deleted all snapshots, but nothing changed. Any ideas? From Disk Utility From Terminal
Vitaliy Kravchyshyn
  • 198
  • 1
  • 2
  • 11
5
votes
1 answer

Dynamic partition cannot be the parent of a static partition '3'

While inserting data into table hive threw the error "Dynamic partition cannot be the parent of a static partition '3'" using below query INSERT INTO TABLE student_partition PARTITION(course , year = 3) SELECT name, id, course FROM student1 WHERE…
ram
  • 183
  • 2
  • 6
5
votes
2 answers

Python Partition By

I have the below dataframe df: | Staff_ID | Join_Date | Time_Stamp | |----------|-----------|------------| | 1 | 3/29/2016 | 4/23/2016 | | 1 | 3/29/2016 | 3/29/2016 | | 1 | 3/29/2016 | 6/21/2016 | | 2 | 5/15/2016 |…
Symphony
  • 1,655
  • 4
  • 15
  • 22
5
votes
3 answers

Partition a set in Haskell

I'm trying to write a Haskell program that could return the partition set of a user defined set. The partition of a set S is defined as a set of nonempty, pairwise disjoint subsets of S whose union is S. So, [1,2,3] returns…
Matt Robbins
  • 429
  • 2
  • 5
  • 10
5
votes
1 answer

Spark mapPartitions vs transient lazy val

I was wondering what is the different of using sparks mapPartitions functionality vs transient lazy val. Since each partition is basically running on a different node a single instance of transient lazy val will be created on each nod (assuming its…
Noam Shaish
  • 1,613
  • 2
  • 16
  • 37
5
votes
1 answer

Can I delete a Kafka Partition version 0.10.0.1

We have a requirement that demands to delete/purge data for any given partition within a topic. I am using Kafka 0.10.0.1. Is there any way I can delete entire partition content on demand? If yes then how. I see that we can use log compaction to…
sc so
  • 303
  • 1
  • 5
  • 13
5
votes
4 answers

BigQuery (BQ) - Drop Partition

I'm using the BQ CLI (https://cloud.google.com/bigquery/bq-command-line-tool). I didn't find how to Delete DAY Partition data. For example, i have a DAY PARTITIONED table that holds data for dates 2016-09-01 and until 2016-09-30. I need to delete…
shayms8
  • 671
  • 6
  • 13
  • 28
5
votes
2 answers

Creating a Swap Partition in AWS/EC2

I have a t2.micro Ubuntu Server 1GB RAM and 30GB Hard Drive (HD). I am in need to take 2GB out of the 30GB HD in order to create a Swap partition. Could someone give me a help on how to that? I have a doubt if whether I should create the swap…
5
votes
1 answer

How to get partition column name from partition table in oracle server

I am newbie in oracle and i want to get partition column name form partition name. same query working in MySQL: SELECT PARTITION_EXPRESSION FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA = ? AND TABLE_NAME = ? limit 1 this query will give…
dubey
  • 341
  • 1
  • 2
  • 9
5
votes
3 answers

Partitioned Job can't stop by itself after finishing? Spring Batch

I wrote a Job of two Steps, with one of two steps being a partitioning step. The partition step uses TaskExecutorPartitionHandler and runs 5 slave steps in threads. The job is started in the main() method. But it's not stopping after every slave…
wokmi
  • 71
  • 1
  • 2
  • 4
5
votes
1 answer

Oracle Get sum of distinct group without subquery

I already have a working example which does exactly what I need. Now the problem is, that I'm not really a fan of subqueries and I think there could be a better solution to this problem. So here is my (already) working example: with t as ( select …