Skip Headers
Oracle® Big Data Connectors User's Guide
Release 2 (2.1)

Part Number E36961-05
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

hdfs.head

Copies a specified number of lines from the beginning of a file in HDFS.

Usage

hdfs.head(
        dfs.id,
        n)

Arguments

dfs.id

The name of a file in HDFS. The file name can include a path that is either absolute or relative to the current path.

n

The number of lines to retrieve from the file. The default is 10.

Return Value

The first n lines of the file.

See Also

hdfs.tail

Example

This example returns the first two lines of ontime_R:

R> hdfs.head('ontime_R', 2)
[1] "\"\",\"YEAR\",\"MONTH\",\"MONTH2\",\"DAYOFMONTH\",\"DAYOFMONTH2\",\"DAYOFWEEK\",\"DEPTIME\",\"CRSDEPTIME\",\"ARRTIME\",\"CRSARRTIME\",\"UNIQUECARRIER\",\"FLIGHTNUM\",\"TAILNUM\",\"ACTUALELAPSEDTIME\",\"CRSELAPSEDTIME\",\"AIRTIME\",\"ARRDELAY\",\"DEPDELAY\",\"ORIGIN\",\"DEST\",\"DISTANCE\",\"TAXIIN\",\"TAXIOUT\",\"CANCELLED\",\"CANCELLATIONCODE\",\"DIVERTED\""
[2] "\"1\",1994,8,\"M08\",2,\"D02\",2,840,840,1126,1130,\"NW\",878,NA,106,110,NA,-4,0,\"MEM\",\"TPA\",656,NA,NA,0,NA,\"0\""