Create external table in Hive

Problem

Given several partitioned AVRO formatted files, together with the AVSC schema, we want to create a table in Hive.

We have hundreds of files in a directory partitioned by year and mont in the HDFS folder /data/mytable.db/mytable.
The folder structure is:
/data/mytable.db/mytable/Year=2018/month=11
/data/mytable.db/mytable/Year=2018/month=12
/data/mytable.db/mytable/Year=2019/month=1
/data/mytable.db/mytable/Year=2019/month=2
/data/mytable.db/mytable/Year=2019/month=3
/data/mytable.db/mytable/Year=2019/month=4

Continue reading

Exporting Docker images

Sometimes you want to move docker images from one machine to another and you don’t have a proper docker registry or it is not availabe.

Docker provides commands for that:

But these images can be really big in size, there is an alternative to save only the current container, no the image with all its historic data.

Continue reading

How to clear the CUPS print queue

To cancel a print job in the queue just use cancel. To see all the available jobs in the queue just use lpstat.

$ lpstat -o
HP-Officejet-7610-2-128 user2     240640   mié 09 mar 2016 11:07:14 CET
HP-Officejet-Pro-8620-137 jose             55296   dom 03 jul 2016 13:29:49 CEST
$ cancel -a HP-Officejet-7610-2-128
$ cancel -a HP-Officejet-Pro-8620-137

xterm-256color: Unknown terminal type

Problem

If you connect to a Solaris by ssh from Linux or MacOSX you can get the following message when using vi:

# vi httpd.conf
xterm-256color: Unknown terminal type
I don't know what kind of terminal you are on - all I have is 'xterm-256color'.
[Using open mode]
"httpd.conf" 705 lines, 24071 characters
#
# This is the main Apache HTTP server configuration file. It contains the

Solution

Define the TERM environment variable:

# export TERM=xterm

Now you can execute vi:

# vi httpd.conf

This change is valid just for the current Terminal session. If you want to make it permanent you have to add that export to your ~/.bashrc file. If you want to make the change permanent for all the users you can edit the /etc/profile file or add a new file in /etc/profile.d/