You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by AhyoungRyu <gi...@git.apache.org> on 2016/06/21 00:52:26 UTC

[GitHub] zeppelin pull request #1055: [ZEPPELIN-1028] Fix exported notebook importing...

GitHub user AhyoungRyu opened a pull request:

    https://github.com/apache/zeppelin/pull/1055

    [ZEPPELIN-1028] Fix exported notebook importing error

    ### What is this PR for?
    
    This bug seems to be produced by #862. Currently a exported notebook is not imported with below error message.
    
    ```
    ERROR [2016-06-20 17:19:21,797] ({qtp559670971-14} NotebookServer.java[onMessage]:231) - Can't handle message
    com.google.gson.JsonSyntaxException: 2016-06-20T14:33:31-0700
    	at com.google.gson.internal.bind.DateTypeAdapter.deserializeToDate(DateTypeAdapter.java:81)
    	at com.google.gson.internal.bind.DateTypeAdapter.read(DateTypeAdapter.java:66)
    	at com.google.gson.internal.bind.DateTypeAdapter.read(DateTypeAdapter.java:41)
    	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:93)
    	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:172)
    	at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40)
    	at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:81)
    	at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:60)
    	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:93)
    	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:172)
    	at com.google.gson.Gson.fromJson(Gson.java:791)
    	at org.apache.zeppelin.notebook.Notebook.importNote(Notebook.java:199)
    	at org.apache.zeppelin.socket.NotebookServer.importNote(NotebookServer.java:656)
    	at org.apache.zeppelin.socket.NotebookServer.onMessage(NotebookServer.java:175)
    	at org.apache.zeppelin.socket.NotebookSocket.onWebSocketText(NotebookSocket.java:56)
    	at org.eclipse.jetty.websocket.common.events.JettyListenerEventDriver.onTextMessage(JettyListenerEventDriver.java:128)
    	at org.eclipse.jetty.websocket.common.message.SimpleTextMessage.messageComplete(SimpleTextMessage.java:69)
    	at org.eclipse.jetty.websocket.common.events.AbstractEventDriver.appendMessage(AbstractEventDriver.java:65)
    	at org.eclipse.jetty.websocket.common.events.JettyListenerEventDriver.onTextFrame(JettyListenerEventDriver.java:122)
    	at org.eclipse.jetty.websocket.common.events.AbstractEventDriver.incomingFrame(AbstractEventDriver.java:161)
    	at org.eclipse.jetty.websocket.common.WebSocketSession.incomingFrame(WebSocketSession.java:309)
    	at org.eclipse.jetty.websocket.common.extensions.ExtensionStack.incomingFrame(ExtensionStack.java:214)
    	at org.eclipse.jetty.websocket.common.Parser.notifyFrame(Parser.java:220)
    	at org.eclipse.jetty.websocket.common.Parser.parse(Parser.java:258)
    	at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.readParse(AbstractWebSocketConnection.java:632)
    	at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:480)
    	at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
    	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
    	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
    	at java.lang.Thread.run(Thread.java:745)
    Caused by: java.text.ParseException: Unparseable date: "2016-06-20T14:33:31-0700"
    	at java.text.DateFormat.parse(DateFormat.java:366)
    	at com.google.gson.internal.bind.DateTypeAdapter.deserializeToDate(DateTypeAdapter.java:79)
    ```
    This PR is only for exported notebook. So it should be tested after #1043 merged.
    
    ### What type of PR is it?
    Bug Fix
    
    ### Todos
    * [ ] - Merge with master after #1043 merged
    
    ### What is the Jira issue?
    [ZEPPELIN-1028](https://issues.apache.org/jira/browse/ZEPPELIN-1028)
    
    ### How should this be tested?
    1. Apply this patch (Build the source and restart Zeppelin)
    2. Export a notebook and try to import it again
    3. It should be imported as before
    
    ### Screenshots (if appropriate)
    
    ### Questions:
    * Does the licenses files need update? No
    * Is there breaking changes for older versions? No
    * Does this needs documentation? No
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/AhyoungRyu/incubator-zeppelin ZEPPELIN-1028

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/zeppelin/pull/1055.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1055
    
----
commit f78fab9e699b5641704dafda9b7e9873773a3cc3
Author: AhyoungRyu <fb...@hanmail.net>
Date:   2016-06-21T00:39:42Z

    Fix exported notebook importing error

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin pull request #1055: [ZEPPELIN-1028] Fix exported notebook importing...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/zeppelin/pull/1055


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #1055: [ZEPPELIN-1028] Fix exported notebook importing error

Posted by AhyoungRyu <gi...@git.apache.org>.
Github user AhyoungRyu commented on the issue:

    https://github.com/apache/zeppelin/pull/1055
  
    @sixmen I updated this patch as your second suggestion.
    <img width="461" alt="screen shot 2016-06-21 at 7 45 52 pm" src="https://cloud.githubusercontent.com/assets/10060731/16253158/e85fe5f6-37e8-11e6-89a2-f5a11ea21a96.png">
    
    My test server is in KST timezone. As you can see the above screenshot, displayed elapse time show local time as before. And we can also import the exported notebook :)
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #1055: [ZEPPELIN-1028] Fix exported notebook importing error

Posted by AhyoungRyu <gi...@git.apache.org>.
Github user AhyoungRyu commented on the issue:

    https://github.com/apache/zeppelin/pull/1055
  
    @sixmen Good to hear that :)
    IMO it would be better we support only unified date format from now on. And regarding 
    > But it may fail to import an exported notebook from old version(e.x 0.5.6).
    
    I can write down about this to [https://zeppelin.apache.org/docs/0.6.0-SNAPSHOT/quickstart/explorezeppelinui.html#home-page](https://zeppelin.apache.org/docs/0.6.0-SNAPSHOT/quickstart/explorezeppelinui.html#home-page) so that ppl know. What do you think ? 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #1055: [ZEPPELIN-1028] Fix exported notebook importing error

Posted by AhyoungRyu <gi...@git.apache.org>.
Github user AhyoungRyu commented on the issue:

    https://github.com/apache/zeppelin/pull/1055
  
    @sixmen I see, thanks for sharing your problem. Let me check more then :) 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #1055: [ZEPPELIN-1028] Fix exported notebook importing error

Posted by sixmen <gi...@git.apache.org>.
Github user sixmen commented on the issue:

    https://github.com/apache/zeppelin/pull/1055
  
    This patch is what I thought.
    But it may fail to import an exported notebook from old version(e.x 0.5.6).
    If you don't mind backward-compatibility, I think this patch is OK.
    Otherwise, it may support two date formats.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #1055: [ZEPPELIN-1028] Fix exported notebook importing error

Posted by sixmen <gi...@git.apache.org>.
Github user sixmen commented on the issue:

    https://github.com/apache/zeppelin/pull/1055
  
    I'm running the zeppelin server on my server and my server's timezone is UTC.
    
    I think the problem is happened if PC's timezone is different from server's timezone.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #1055: [ZEPPELIN-1028] Fix exported notebook importing error

Posted by AhyoungRyu <gi...@git.apache.org>.
Github user AhyoungRyu commented on the issue:

    https://github.com/apache/zeppelin/pull/1055
  
    @bzz Actually I look into #1043, I found that this bug is not related with #1043. So I updated the description of this PR :)  


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #1055: [ZEPPELIN-1028] Fix exported notebook importing error

Posted by AhyoungRyu <gi...@git.apache.org>.
Github user AhyoungRyu commented on the issue:

    https://github.com/apache/zeppelin/pull/1055
  
    @sixmen Really appreciate for sharing your feedback. I'm in PDT timezone, but I can't reproduce your situation. Here is my case.
    
     - Before applying this patch(latest master branch)
    
    <img width="404" alt="screen shot 2016-06-20 at 9 41 30 pm" src="https://cloud.githubusercontent.com/assets/10060731/16218337/5a66c0b0-3731-11e6-969b-6d03fce99821.png">
    
    In this case, we can't import the exported notebook because of the date format as we said.
    
     - After applying this patch
    
    <img width="456" alt="screen shot 2016-06-20 at 9 51 09 pm" src="https://cloud.githubusercontent.com/assets/10060731/16218341/6c102978-3731-11e6-82a0-2d2697879e79.png">
    
      


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #1055: [ZEPPELIN-1028] Fix exported notebook importing error

Posted by bzz <gi...@git.apache.org>.
Github user bzz commented on the issue:

    https://github.com/apache/zeppelin/pull/1055
  
    Looks good to me, let's test and merge right after #1043 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #1055: [ZEPPELIN-1028] Fix exported notebook importing error

Posted by corneadoug <gi...@git.apache.org>.
Github user corneadoug commented on the issue:

    https://github.com/apache/zeppelin/pull/1055
  
    Having backward compatibility and transforming old notebooks into new format would be better.
    Adding it to the doc would be a plus, however being sure that nobody end up with issues for now is better.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #1055: [ZEPPELIN-1028] Fix exported notebook importing error

Posted by Leemoonsoo <gi...@git.apache.org>.
Github user Leemoonsoo commented on the issue:

    https://github.com/apache/zeppelin/pull/1055
  
    LGTM and merge if there're no more discussions.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #1055: [ZEPPELIN-1028] Fix exported notebook importing error

Posted by sixmen <gi...@git.apache.org>.
Github user sixmen commented on the issue:

    https://github.com/apache/zeppelin/pull/1055
  
    Times in the web interface will show UTC times instead of local times if this patch is applied.
    
    Before applying this patch,
    <img width="372" alt="2016-06-21 12 06 33" src="https://cloud.githubusercontent.com/assets/1409279/16216867/5f5cc2b8-37a9-11e6-81fe-80e92878bdb8.png">
    
    After applying this patch, (I'm at Seoul(+09:00))
    <img width="360" alt="2016-06-21 12 01 31" src="https://cloud.githubusercontent.com/assets/1409279/16216874/6e2ae766-37a9-11e6-9c44-9e7133bc614d.png">
    
    I think there are two ways to solve this problem.
    
    First, export a date as natural format (like Jun 21, 2016 2:28:24 AM), and convert UTC to local in web interface.
    
    ( modify ```moment(pdata.dateUpdated).format('MMMM DD YYYY, h:mm:ss A')``` to ```moment.utc(pdata.dateUpdated).local().format('MMMM DD YYYY, h:mm:ss A')``` )
    
    Second, export a date as ISO 8601, and modify importing code.
    
    ( modify zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Notebook.java#importNode 's GsonBuilder to recognize ISO 8601 & natural format )
    
    
    The second must be support two format (ISO 8601 for exported notebooks from new app and natural format for exported notebooks from old app), so I think first solution is simpler.
    But I think standard format(ISO 8601) is preferable for interchange format.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #1055: [ZEPPELIN-1028] Fix exported notebook importing error

Posted by sixmen <gi...@git.apache.org>.
Github user sixmen commented on the issue:

    https://github.com/apache/zeppelin/pull/1055
  
    It works well in my test.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #1055: [ZEPPELIN-1028] Fix exported notebook importing error

Posted by AhyoungRyu <gi...@git.apache.org>.
Github user AhyoungRyu commented on the issue:

    https://github.com/apache/zeppelin/pull/1055
  
    @corneadoug Thank you for sharing your opinion and I agree with you. So I made it to support below two date format for backward compatibility.
     -  `yyyy-MM-dd'T'HH:mm:ssZ` : exported after #862 merged
    <img width="289" alt="screen shot 2016-06-22 at 12 18 01 pm" src="https://cloud.githubusercontent.com/assets/10060731/16280468/6ebad710-3874-11e6-9ce6-b38e239649a2.png">
    
     - `MMM dd, yyyy HH:mm:ss` : exported before #862 merged
    <img width="288" alt="screen shot 2016-06-22 at 12 17 31 pm" src="https://cloud.githubusercontent.com/assets/10060731/16280459/6a4f256e-3874-11e6-848e-ec1ff6e9b441.png">
    
    Now we can import both exported `.json` notebooks which have the above date format.
    
    @sixmen If possible, could you check the updated patch ? :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #1055: [ZEPPELIN-1028] Fix exported notebook importing error

Posted by AhyoungRyu <gi...@git.apache.org>.
Github user AhyoungRyu commented on the issue:

    https://github.com/apache/zeppelin/pull/1055
  
    @sixmen Yeah thanks for clarifying it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---