DZone
Big Data Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Big Data Zone > Quick Tips: Apache Phoenix and Zeppelin

Quick Tips: Apache Phoenix and Zeppelin

Quick tips to keep in mind when querying Phoenix from Zeppelin and to quickly add graphics to Zeppelin tables.

Tim Spann user avatar by
Tim Spann
CORE ·
Jan. 13, 17 · Big Data Zone · Tutorial
Like (2)
Save
Tweet
4.57K Views

Join the DZone community and get the full member experience.

Join For Free

Image title

When querying Phoenix from Zeppelin, you can display images and do other HTML right inside your query results.

For building an image:

%jdbc(phoenix)

select '%html <img width=50 height=60 src="' ||  profile_image_url || 
'">' as imgp,substr(inception,131,150) as inception, 
substr(sentiment,0,60) as sentiment,
       handle,substr(msg,0,60) as msg, time, location,
       stanfordsentiment, followers_count, hashtags
from tweets where handle = 'hortonworks' and inception is not null

As you can see, to add HTML you merely have to use '%html to start your HTML segment within your query. The syntax is very particular and you must encode quotes.   The easiest option is to use double quotes for all HTML quotes inside your HTML sections.   To add variables and other pieces, the concatenation operator in Apache Phoenix is the double pipe (||).

This will let you quickly add graphics to your Zeppelin tables.

Image title

References

  • Apache Phoenix String Syntax

  • Apache Phoenix Tutorials

  • Zeppelin with WebSockets

  • Routing Logs Through Apache NiFi To Apache Phoenix 

Apache Phoenix

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • My Sentiments, Erm… Not Exactly
  • Datafaker: An Alternative to Using Production Data
  • MACH Architecture Explained
  • OAuth vs JWT (JSON Web Tokens): An In-Depth Comparison

Comments

Big Data Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo