Hive不承认路径中的下划线

时间:2015-07-17 00:56:12

标签: sql hadoop hive

我正在尝试将HDFS上的一些CSV文件导入Hive。

Create table if not exists mytable (
    customer_id BIGINT,
    device_serial_number STRING,
    device_software_version BIGINT,
    device_type BIGINT,
    market_place BIGINT,
    reader_software_version BIGINT,
    source_string_list_version INT,
    message_datetime STRING,
    message_string STRING    
  )
ROW FORMAT DELIMITED
        FIELDS TERMINATED BY '\t'
STORED AS TEXTFILE
Location '/hive/.../output001/_se';
select * from mytable

我使用此

收到错误
java.io.IOException: org.apache.hadoop.mapred.InvalidInputException: Input path does not exist....

如果我摆脱“_”,使用

Location '/hive/.../output001/se';

工作正常。

我明白一种方法是将我的数据输出到没有下划线的文件夹,但不幸的是我不能这样做。

这是下划线真正的问题,我如何让Hive认出它?

感谢。

1 个答案:

答案 0 :(得分:0)

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                <addResources>true</addResources>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <version>3.0.0-M1</version>
        </plugin>
    </plugins>
</build>

<distributionManagement>
    <snapshotRepository>
        <id>my-maven-snapshots</id>
        <url>http://my-nexus-server/nexus/repository/maven-snapshots/</url>
    </snapshotRepository>
    <repository>
        <id>my-maven-releases</id>
        <url>http://my-nexus-server/nexus/repository/maven-releases/</url>
    </repository>
</distributionManagement>

<scm>
    <connection>scm:git:https://johndoe@bitbucket.org/johndoe/todo.git</connection>
    <url>https://johndoe@bitbucket.org/johndoe/todo</url>
    <developerConnection>scm:git:https://johndoe@bitbucket.org/johndoe/todo.git</developerConnection>
    <tag>HEAD</tag>
</scm>