【异常】Exception in thread "main" java.lang.IllegalArgumentException: Illegal pattern c

在windows上执行的时候,option(“timestampFormat”, “yyyy/MM/dd HH:mm:ss ZZ”)必须带上,不然报错:

Exception in thread "main" java.lang.IllegalArgumentException: Illegal pattern component: XX。

使用比如:
val df1 = spark.read.format("json").option("timestampFormat", "yyyy/MM/dd HH:mm:ss ZZ").load("hdfs://192.168.137.141:9000/data/people.json")
df1.show()

原文地址:https://www.cnblogs.com/huomei/p/12094046.html

时间: 2024-10-07 13:24:22

【异常】Exception in thread "main" java.lang.IllegalArgumentException: Illegal pattern c的相关文章

Exception in thread "main" java.lang.IllegalArgumentException

1.错误描述 Exception in thread "main" java.lang.IllegalArgumentException: Cannot format given Object as a Date at java.text.DateFormat.format(DateFormat.java:301) at java.text.Format.format(Format.java:157) at com.you.util.DateBefore.getMonthBefore(

启动hive错误:Exception in thread "main" java.lang.IllegalArgumentException

启动hive错误:Exception in thread "main" java.lang.IllegalArgumentException 2018-03-20 15:19:07 Gethin_H 阅读数 1357更多 分类专栏: Hive 版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明. 本文链接:https://blog.csdn.net/Gethin_H/article/details/79626223 启动hive时报错了

Hbase delete遇到的常见异常: Exception in thread "main" java.lang.UnsupportedOperationException

hbase 执行批量删除时出现错误: Exception in thread "main" java.lang.UnsupportedOperationException at java.util.AbstractList.remove(AbstractList.java:161) at org.apache.hadoop.hbase.client.HTable.delete(HTable.java:852) 这种异常其实很常见,remove操作不支持,为什么会出现不支持的情况呢?检查

dom4j使用xpath报异常 Exception in thread "main" java.lang.NoClassDefFoundError: org/jaxen/NamespaceContext

Exception in thread "main" java.lang.NoClassDefFoundError: org/jaxen/NamespaceContext at org.dom4j.DocumentFactory.createXPath(DocumentFactory.java:230 ) at org.dom4j.tree.AbstractNode.createXPath(AbstractNode.java:207) at org.dom4j.tree.Abstrac

Exception in thread "main" java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: ${system:java.io.tmpdir%7D/$%7Bsystem:user.name%7D

问题原因是Hive里面配置的相对路径没有找到,我们可以直接在文件里面修改为绝对路径. 1.在hive下面窗口temp文件夹 cd /opt/hive mkdir temp cd temp 2.查看temp所在路径 pwd temp 3.进入hive-site.xml里面 vim /opt/hive/conf/hive-site.xml 4.搜索system:java.io.tmpdir字样的东西,修改为绝对路径(/opt/hive/apache-hive-2.3.6-bin/temp)就可以了.

Spring报错:Exception in thread "main" java.lang.IllegalArgumentException at org.springframework.asm.ClassReader.<init>(Unknown Source)

简单搭建了一个Spring Maven工程就报错: 看到网上说是JDK 7 和 Spring3.x :JDK编译级别设置成1.7,仍然没有得到解决,采用版本为  3.2.0.RELEASE <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId>

Junit测试出现异常:Exception in thread &quot;main&quot; java.lang.NoSuchMethodError: org.junit.platform.commons.util.

在进行单元测试时,测试出现异常 Exception in thread "main" java.lang.NoSuchMethodError: org.junit.platform.commons.util.ReflectionUtils.getDefaultClassLoader()Ljava/lang/ClassLoader; 错误就在pom.xml的依赖中,仔细查看控制台输出你会发现IntelliJ IDEA正在尝试使用JUnit5运行我的测试用例. at com.intelli

【异常】idea执行Main方法出现 Exception in thread &quot;main&quot; java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest

一.异常复现步骤 1)首先得是一个Spring MVC项目 注:Spring Boot项目有内置的web 容器,不会出现该问题 2)main方法存在于使用HttpServletRequest类的类中 3)项目POM中引入有javax.servlet-api坐标或没有 <!-- Servlet --> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-ap

2类型转换异常:Exception in thread &quot;main&quot; java.lang.ClassCastException:java.lang.Object cannot be cast to java.lang.Integer

public class TestException {    public static void main(String[] args) {        Object obj = new Integer(1);        int i =(Integer)(obj);        System.out.println(i);                Object object = new Object();        if (object instanceof Integer