Make condition in Apache Avro Schema - schema

I am new to apche avro, I understand many apache avro techniques, But now I want to add conditions in Apache avro schema. Is it possible?
Like using IF Else in apache avro.

Related

Hive to read encrypted Parquet files

I have an encrypted parquet file that I would like to read in Hive through an external table. If the file is not encrypted, I can read without any problem.
Per PARQUET-1817, I should set parquet.crypto.factory.class to my implementation of the DecryptionPropertiesFactory interface, but I'm not quite sure where to put this setting. I tried a couple of places, but none of them is working. The example in PARQUET-1817 is using Spark. I tested this example and it's working without any issue in Spark, so my implementation of the DecryptionPropertiesFactory interface must be ok.
So now, I'm wondering if Hive supports PARQUET-1817. If so, how should I config it? I'm using Hive 3.1.3 with Hive Standalone Metastore 3.0.0.
Thanks.

IGFS replacement for storing files in Apache Ignite

I have been searching for a way where I can store my csv files in apache ignite and found IGFS and then discovered it was not in the version I am using currently. I wanted to ask is there a similar way to store files?

Spring cloud steam registry and Avro schema files

I've setup the Spring Avro schema registry provided in Spring Cloud Stream for use in RabbitMQ. Most examples I see use the Maven Avro plugin to generate Java classes from schema resource files. The schema files are then registered in the schema registry. My understanding is that this registry enables a message to be serdes with just a reference to a registered schema instead of including the entire schema in the message. What I don't understand is how these schema files are subsequently distributed amongst all services at design-time to generate Java class files. The Maven plugin requires the schema files to be on the classpath. What is best practice in dealing with Avro schema definitions? Any advance would be greatly appreciated.
The message producer, defines the message format with the schema. Once done they register the schema in Schema registry and let the other services know what is the schema/schema id.
Then consumers can fetch the schema from schema registry and generate POJO classes based on the schema.
As time goes, producer may alter the schema (according to Avro rules), but still the consumer should be able to receive the messages without any change to the producer.

Hive LLAP doesn't work with Parquet format

After finding out Hive LLAP, I really want to use it.
I started Azure HDinsight cluster with LLAP enabled. However, it doesn't seem to work any better than normal Hive. I have data stored in Parquet files. I only see ORC files mentioned in LLAP related docs or talks.
Does it also support Parquet format?
Answering my own question.
We reached out to Azure support. Hive LLAP only works with ORC file format (as of 05.2017).
So with Parquet either we have to use Apache Impala for fast interactive queries (https://impala.incubator.apache.org) as alternative to LLAP or change the stored file format to ORC.
Update: This is currently work in progress and no longer be the case with the next release of HDP. As of HDP 3.0. LLAP will support caching for the Parquet file format. This update should flow into HDInsights shortly after the 3.0 release.

Sentiment Analysis of Twitter

Sir I want to do the sentiments analysis of twitter data using Apache hive , flume Now I have a twitter account and i have set the conf file .But the problem is with format of data . it is not loading in hive .Kindly help me, I am working in it for a month.
I think you are able to configure the Flume agent to fetching the data from Twitter. Your problem is the format of the data.
Apache Flume offers several Sink Types. Two of them are useful to your requirement.
HDFS Sink
Hive Sink
Using HDFS Sink:
Configure Flume agent with TwitterSource and HDFS Sink.
Provide your Twitter OAuth details i.e., keys to Flume Agent.
Once Agent configuration is done, then start it.
This agent will fetch the data i.e., tweets from Twitter and stores it
in HDFS path as JSON Documents.
Once data is available in HDFS, the create an Hive external table with JSON SerDe with location clause.
JSON SerDe Code link: https://github.com/cloudera/cdh-twitter-example/blob/master/hive-serdes/src/main/java/com/cloudera/hive/serde/JSONSerDe.java
Using Hive Sink:
Flume allows writing the data into Hive Table using Hive Sink. So we need to configure the Flume agent as follows:
TwiiterSource --> Channel --> Hive Sink
Configure Flume agent with TwitterSource and Hive Sink.
Provide your Twitter OAuth details i.e., keys to Flume Agent.
Once Agent configuration is done, then start it.
This agent will fetch the data i.e., tweets from Twitter and stores it
in Hive table. This uses JSON SerDe.
Hive Sink has parameter called serializer to tell the type of SerDe.
Supported serializers: DELIMITED and JSON
So please configure your Flume agent using any one of the way above solutions.
Please use this documentation link to get the more details about Sink Parameters (HDFS + Hive)
https://flume.apache.org/FlumeUserGuide.html
You can try adding this jar file
hive-serdes-1.0-SNAPSHOT.jar
You can follow the below blog for complete reference of performing sentiment analysis using Hive.
https://acadgild.com/blog/sentiment-analysis-on-tweets-with-apache-hive-using-afinn-dictionary/