partition

Performing range queries for cassandra table

匿名 (未验证) 提交于 2019-12-03 08:59:04
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to store data with following schema: CREATE TABLE temp_humidity_data ( asset_id text, date text, event_time timestamp, temprature int, humidity int, PRIMARY KEY((asset_id, date),event_time) ) I have followed datastax article 'Getting Started with Time Series Modeling' - http://planetcassandra.org/blog/post/getting-started-with-time-series-data-modeling/ however with this data model one thing that is not working is query that returns me data between two dates. How do I do that? If I do this: select * from temp_humidity_data where

Cannot resize AWS EBS root volume or create larger swap partition [closed]

匿名 (未验证) 提交于 2019-12-03 08:52:47
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a Amazon Web Services EC2 Debian 8.0 instance with an Elastic Block Storage (EBS) volume of 35GB. fdisk correctly shows the size but my root partition is still at 7.8G, although I tried to execute resize2fs. root@ip-10-0-3-164:/home/admin# fdisk -l Disk /dev/xvda: 35 GiB, 37580963840 bytes, 73400320 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x7d936f86 Device Boot Start End Sectors Size Id

BAT/CMD file to remove drive letters using DISKPART

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to write a batch file to remove drive letters that are assigned to partitions with no file system. I cannot use wmi since it is being used in a WinPE recovery environment. DISKPART> list volume Volume ### Ltr Label Fs Type Size Status Info ---------- --- ----------- ----- ---------- ------- --------- -------- Volume 0 K DVD-ROM 0 B No Media Volume 1 L DVD-ROM 0 B No Media Volume 2 C Windows 7 NTFS Partition 80 GB Healthy System Volume 3 D Partition 500 GB Healthy System Volume 4 Partition 500 GB Healthy System Volume 5 E

order by clause not working in Cassandra query

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have created a table layer using following code: CREATE TABLE layer ( layer_name text, layer_position text, PRIMARY KEY (layer_name, layer_position) ) WITH CLUSTERING ORDER BY (layer_position DESC) I use the below query to fetch data from the layer table in descending order(layer): $select = new Cassandra\SimpleStatement(<<<EOD select * from layer ORDER BY layer_position DESC EOD ); $result = $session->execute($select); But this query is not working. Please can anyone help me? 回答1: Simply put, Cassandra only enforces sort order within a

hive

我的梦境 提交于 2019-12-03 08:09:38
背景 • 引入原因:   – 对存在HDFS上的文件或HBase中的表进行查询时,是要手工写一堆MapReduce代码 – 对于统计任务,只能由动MapReduce的程序员才能搞定 – 耗时耗力,更多精力没有有效的释放出来 • Hive基于一个统一的查询分析层,通过SQL语句的方式对HDFS上的数据进行查询、统计和分析 Hive 是什么 • Hive是一个SQL解析引擎,将SQL语句转译成MR Job,然后再Hadoop平台上运行,达到快速 开发的目的。 • Hive中的表是纯逻辑表,就只是表的定义等,即表的元数据。本质就是Hadoop的目录/文件, 达到了元数据与数据存储分离的目的 • Hive本身不存储数据,它完全依赖HDFS和MapReduce。 • Hive的内容是读多写少,不支持对数据的改写和删除 • Hive中没有定义专门的数据格式,由用户指定,需要指定三个属性:   – 列分隔符   – 行分隔符    – 读取文件数据的方法 HIve 中的SQL 与传统SQL区别 与传统关系数据库特点比较 • hive和关系数据库存储文件的系统不同,hive使用的是hadoop的HDFS(hadoop的分布式文件 系统),关系数据库则是服务器本地的文件系统; • hive使用的计算模型是mapreduce,而关系数据库则是自己设计的计算模型; •

Creating multiple partitions on USB using C#

匿名 (未验证) 提交于 2019-12-03 07:36:14
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Iam trying to use DeviceIOControl to create multiple partiions in USB. It is always creating only one partition. Here is my source code [DllImport("kernel32.dll", SetLastError = true)] static extern IntPtr CreateFile(string lpFileName, uint dwDesiredAccess, uint dwShareMode, IntPtr lpSecurityAttributes, uint dwCreationDisposition, uint dwFlagsAndAttributes, IntPtr hTemplateFile); [DllImport("kernel32")] static extern int CloseHandle(IntPtr handle); [DllImport("kernel32")] private static extern int DeviceIoControl (IntPtr deviceHandle, uint

Hive 教程(四)-分区表与分桶表

不问归期 提交于 2019-12-03 07:07:24
在 hive 中分区表是很常用的,分桶表可能没那么常用,本文主讲分区表。 概念 分区表 在 hive 中,表是可以分区的,hive 表的每个区其实是对应 hdfs 上的一个文件夹; 可以通过多层文件夹的方式创建 多层分区 ; 通过文件夹把数据分开 分桶表 分桶表中的每个桶对应 hdfs 上的一个文件; 通过文件把数据分开 在查询时可以通过 where 指定分区(分桶),提高查询效率 分区表基本操作 1. 创建分区表 partitoned by 指定分区,后面加 分区字段 和 分区字段类型,可以加多个字段,前面是父路径,后面是子路径 create table student_p(id int,name string,sexex string,age int,dept string) partitioned by(part string) row format delimited fields terminated by ',' stored as textfile; 分区表相当于给 表 加了一个字段,然后给这个字段赋予不同的 value,每个 value 对应一个分区,这个 value 对应 hdfs 上文件夹的名字 2. 写入数据 1, zhangsan, f, 30, a, 2, lisi, f, 39, b, 3, wangwu, m, 26, c, 写入两次

分区、分桶和索引

孤街浪徒 提交于 2019-12-03 04:04:46
1.分区 分区是以字段的形式在表结构中存在,通过describe table命令可以查看到字段存在, 但是该字段不存放实际的数据内容,仅仅是分区的表示(伪列)。 (1)静态分区 create table if not exists sopdm.wyp2(id int,name string,tel string) partitioned by(age int) row format delimited fields terminated by ',' stored as textfile; --overwrite是覆盖,into是追加 insert into table sopdm.wyp2 partition(age='25') select id,name,tel from sopdm.wyp; (2)动态分区 --设置为true表示开启动态分区功能(默认为false) set hive.exec.dynamic.partition=true; --设置为nonstrict,表示允许所有分区都是动态的(默认为strict) set hive.exec.dynamic.partition.mode=nonstrict; --insert overwrite是覆盖,insert into是追加 set hive.exec.dynamic.partition.mode

oracle表分区二 转

与世无争的帅哥 提交于 2019-12-03 03:55:29
此文从以下几个方面来整理关于分区表的概念及操作: 1.表空间及分区表的概念 2.表分区的具体作用 3.表分区的优缺点 4.表分区的几种类型及操作方法 5.对表分区的维护性操作. (1.) 表空间及分区表的概念 表空间: 是一个或多个数据文件的集合,所有的数据对象都存放在指定的表空间中,但主要存放的是表, 所以称作表空间。 分区表: 当表中的数据量不断增大,查询数据的速度就会变慢,应用程序的性能就会下降,这时就应该考虑对表进行分区。表进行分区后,逻辑上表仍然是一张完整的表,只是将表中的数据在物理上存放到多个表空间(物理文件上),这样查询数据时,不至于每次都扫描整张表。 ( 2).表分区的具体作用 Oracle的表分区功能通过改善可管理性、性能和可用性,从而为各式应用程序带来了极大的好处。通常,分区可以使某些查询以及维护操作的性能大大提高。此外,分区还可以极大简化常见的管理任务,分区是构建千兆字节数据系统或超高可用性系统的关键工具。 分区功能能够将表、索引或索引组织表进一步细分为段,这些数据库对象的段叫做分区。每个分区有自己的名称,还可以选择自己的存储特性。从数据库管理员的角度来看,一个分区后的对象具有多个段,这些段既可进行集体管理,也可单独管理,这就使数据库管理员在管理分区后的对象时有相当大的灵活性。但是,从应用程序的角度来看,分区后的表与非分区表完全相同,使用 SQL DML

Hadoop上 Hive 操作

我是研究僧i 提交于 2019-12-03 03:54:13
数据dept表的准备: --创建dept表 CREATE TABLE dept( deptno int, dname string, loc string) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' STORED AS textfile; 数据文件准备: vi detp.txt 10,ACCOUNTING,NEW YORK 20,RESEARCH,DALLAS 30,SALES,CHICAGO 40,OPERATIONS,BOSTON 数据表emp准备: CREATE TABLE emp( empno int, ename string, job string, mgr int, hiredate string, sal int, comm int, deptno int) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' STORED AS textfile; 表emp数据准备: vi emp.txt 7369,SMITH,CLERK,7902,1980-12-17,800,null,20 7499,ALLEN,SALESMAN,7698,1981-02-20,1600,300,30 7521,WARD,SALESMAN,7698,1981-02-22,1250,500,30 7566