1

I am working on python notebook. I have a tar file that is a package that I want to access as import statements. What command do I have to enter so that I can do something like this import com.netflix.iceberg.hadoop.HadoopTables.

So my path where iceberg package is this: /home/abc/iceberg-0.2.0.7z and my Jupyter notebook is on /home/abc/notebook1. What should I run on my notebook1 to install dependency and make to available?

So I unzipped the file in the same path and tried this on a notebook but didn't work. Could someone help me out here?

import sys
sys.path.append('/home/abc/spark_work/iceberg-0.2.0')
import com.netflix.iceberg.hadoop.HadoopTables
Atihska
  • 4,803
  • 10
  • 56
  • 98

1 Answers1

0

It appears you are trying to load a Java library in Python. You can't really do that (well, technically you sort of can: Using a java library from python). I suggest using Java instead.

I base this on the fact that https://github.com/Netflix/iceberg has release 0.2.0 and it contains only Java code, plus com.netflix.iceberg is a Java naming convention, not a Python one.

See https://github.com/Netflix/iceberg/blob/d9d95f6dcfd6a043f7fed33964d4c64995545208/core/src/main/java/com/netflix/iceberg/hadoop/HadoopTables.java

John Zwinck
  • 239,568
  • 38
  • 324
  • 436
  • Your question is tagged Python and your code in your question is Python. Do you understand that Python is not Java? – John Zwinck Sep 24 '18 at 06:17
  • Sorry my comment should be example in python. The link I mentioned has an example in python and not java. – Atihska Sep 24 '18 at 16:09
  • Thanks for your reply. But they have an example in python like this: github.com/Netflix/iceberg/blob/master/examples/…. So I was trying to run that. – Atihska Sep 24 '18 at 16:09
  • 1
    @Atihska: That example code is *not* Python, it is Scala. See the language declaration at the bottom of this: https://raw.githubusercontent.com/Netflix/iceberg/master/examples/Convert%20table%20to%20Iceberg.ipynb – John Zwinck Sep 25 '18 at 01:13