跳过sparklyr中配置单元外部表的第一行

bkkx9g8r  于 2021-06-26  发布在  Hive
关注(0)|答案(0)|浏览(262)

我有以下数据:

"ElemUID   ElemName    Kind    Number  DaySecFrom(UTC) DaySecTo(UTC)"
"399126817  A648/13FKO-66   DEZ     2017-07-01 23:58:00.000 2017-07-01 23:59:00.000"
"483492732  A661/18FRS-97   DEZ   120.00    2017-07-01 23:58:00.000 2017-07-01 23:59:00.000"
"399126819  A648/12FKO-2    DEZ    60.00    2017-07-01 23:58:00.000 2017-07-01 23:59:00.000"
"399126818  A648/12FKO-1    DEZ   180.00    2017-07-01 23:58:00.000 2017-07-01 23:59:00.000"
"399126816  A648/13FKO-65   DEZ     2017-07-01 23:58:00.000 2017-07-01 23:59:00.000"
"398331142  A661/31OFN-1    DEZ   120.00    2017-07-01 23:58:00.000 2017-07-01 23:59:00.000"
"398331143  A661/31OFN-2    DEZ     2017-07-01 23:58:00.000 2017-07-01 23:59:00.000"
"483492739  A5/28FKN-65 DEZ     2017-07-01 23:58:00.000 2017-07-01 23:59:00.000"
"483492735  A661/23FRS-97   DEZ    60.00    2017-07-01 23:58:00.000 2017-07-01 23:59:00.000"
"483492740  B44/104FSN-33   DEZ   180.00    2017-07-01 23:58:00.000 2017-07-01 23:59:00.000"

我把它装进了hdfs。然后我在配置单元中定义了一个外部表:

CREATE EXTERNAL TABLE IF NOT EXISTS deg
(
ElemUID int,
ElemName string,
Kind string,
Number float,
timefromdeg string,
timetodeg string
)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
LINES TERMINATED BY '\n'
TBLPROPERTIES ("skip.header.line.count"="1");

然后我用 LOAD DATA INPATH.. 现在我想让它装上 tbl() 为了你。每次我这样做的时候,我总是把头作为数据放在第一行:的输出 glimpse() :

Variables: 6
$ elemuid  <int> NA, 399126817, 483492732, 399126819, 399126818, 399126816, 39...
$ elemname <chr> "ElemName", "A648/13FKO-66", "A661/18FRS-97", "A648/12FKO-2",...
$ kind     <chr> "Kind", "DEZ", "DEZ", "DEZ", "DEZ", "DEZ", "DEZ", "DEZ", "DEZ...
$ number   <dbl> NaN, NaN, 120, 60, 180, NaN, 120, NaN, NaN, 60, 180, NaN, NaN...
$ timefrom <dttm> NA, 2017-07-01 23:58:00, 2017-07-01 23:58:00, 2017-07-01 23:...
$ timeto   <dttm> NA, 2017-07-01 23:59:00, 2017-07-01 23:59:00, 2017-07-01 23:...

我觉得这扰乱了我以后的分析。在创建外部 table() 我已经用过了 TBLPROPERTIES ("skip.header.line.count"="1") 有没有可能跳过第一排?
谢谢您!

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题