Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-3699

avro-tools dependency on hadoop

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.11.1
    • 1.13.0
    • java
    • None

    Description

      Hi all, this is not something that hinders the usage of the avro tool but I don't understand why this dependency exists.

      Seems to be more for convenience than anything but for example when I ran the Avro-tool in java I always get this warnings that are a bit annoying.

       

      23/01/05 18:21:24 WARN util.Shell: Did not find winutils.exe: {}
      java.io.FileNotFoundException: java.io.FileNotFoundException: HADOOP_HOME and hadoop.home.dir are unset. -see https://wiki.apache.org/hadoop/WindowsProblems
              at org.apache.hadoop.util.Shell.fileNotFoundException(Shell.java:547)
              at org.apache.hadoop.util.Shell.getHadoopHomeDir(Shell.java:568)
              at org.apache.hadoop.util.Shell.getQualifiedBin(Shell.java:591)
              at org.apache.hadoop.util.Shell.<clinit>(Shell.java:688)
              at org.apache.hadoop.util.StringUtils.<clinit>(StringUtils.java:79)
              at org.apache.hadoop.fs.FileSystem$Cache$Key.<init>(FileSystem.java:3741)
              at org.apache.hadoop.fs.FileSystem$Cache$Key.<init>(FileSystem.java:3736)
              at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:3520)
              at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:540)
              at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:288)
              at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:524)
              at org.apache.hadoop.fs.Path.getFileSystem(Path.java:365)
              at org.apache.avro.tool.Util.openFromFS(Util.java:88)
              at org.apache.avro.tool.Util.fileOrStdin(Util.java:64)
              at org.apache.avro.tool.DataFileReadTool.run(DataFileReadTool.java:87)
              at org.apache.avro.tool.Main.run(Main.java:67)
              at org.apache.avro.tool.Main.main(Main.java:56)
      Caused by: java.io.FileNotFoundException: HADOOP_HOME and hadoop.home.dir are unset.
              at org.apache.hadoop.util.Shell.checkHadoopHomeInner(Shell.java:467)
              at org.apache.hadoop.util.Shell.checkHadoopHome(Shell.java:438)
              at org.apache.hadoop.util.Shell.<clinit>(Shell.java:515)
              ... 13 more
      23/01/05 18:21:24 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
      Output:
      {"name":"r","age":{"int":906},"gender":"MALE","address":{"zipcode":631}}
      {"name":"oYBuz","age":{"int":255},"gender":"FEMALE","address":{"zipcode":690}}
      {"name":"xKMgdHyLw","age":null,"gender":"FEMALE","address":{"zipcode":304}}
      {"name":"MPPsYun","age":null,"gender":"MALE","address":{"zipcode":875}}
      {"name":"XTrq","age":{"int":167},"gender":"MALE","address":{"zipcode":973}}
      {"name":"g","age":null,"gender":"FEMALE","address":{"zipcode":351}}
      {"name":"ynx","age":null,"gender":"FEMALE","address":{"zipcode":525}}
      {"name":"xPFZ","age":null,"gender":"FEMALE","address":{"zipcode":921}}
      {"name":"bRHCLEwdglb","age":{"int":541},"gender":"MALE","address":{"zipcode":123}}
      {"name":"UVcDVhxpyCziyBSiRasp","age":null,"gender":"FEMALE","address":{"zipcode":53}}
      

       

       

      It would be great if this could be improved in a future.

      It might just be that there are some hard requirements in other parts of the tool that require this, so in that case this issue makes no sense.

      But I did try to use the util.logging or log4j config files to ignore this warnings but I was not so lucky.

      something like:

      java -Djava.util.logging.config.file=utillog.properties -jar avro-tools-1.11.1.jar getschema avro/person-10.avro

       

      java -Dlog4j.configurationFile=log4j.properties -jar avro-tools-1.11.1.jar getschema avro/person-10.avro

      Attachments

        Activity

          People

            Unassigned Unassigned
            miguel_costa Miguel Costa
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: