2022.04

2022.04

  • Imply
  • Ingest
  • Query
  • Visualize
  • Administer
  • Deploy

›View Manager

Overview

  • About Imply administration

Manager

  • Using Imply Manager
  • Managing Imply clusters
  • Imply Manager security
  • Extensions

Users

  • Imply Manager users
  • Druid API access
  • Authentication and Authorization

    • Get started with Imply Hybrid Auth
    • Authentication
    • Local users
    • User roles
    • User groups
    • User sessions
    • Brute force attack detection
    • Identity provider integration
    • Okta OIDC integration
    • Okta SAML integration
    • LDAP integration
    • OAuth client authentication

Clarity

  • Monitoring
  • Set up Clarity
  • Cloudwatch monitoring
  • Metrics

Druid administration

  • Configuration reference
  • Logging
  • Druid design

    • Design
    • Segments
    • Processes and servers
    • Deep storage
    • Metadata storage
    • ZooKeeper

    Security

    • Security overview
    • User authentication and authorization
    • LDAP auth
    • Dynamic Config Providers
    • Password providers
    • Authentication and Authorization
    • TLS support
    • Row and column level security

    Performance tuning

    • Basic cluster tuning
    • Segment Size Optimization
    • Mixed workloads
    • HTTP compression
    • Automated metadata cleanup
  • API reference
  • View Manager

    • View Manager
    • View Manager API
    • Create a view
    • List views
    • Delete a view
    • Inspect view load status
  • Rolling updates
  • Retaining or automatically dropping data
  • Alerts
  • Working with different versions of Apache Hadoop
  • Misc

    • dump-segment tool
    • reset-cluster tool
    • pull-deps tool
    • Deep storage migration
    • Export Metadata Tool
    • Metadata Migration

Create a view

Creates a new view for a datasource.

To verify that the Coordinator has propagated your view to all Brokers and that it is ready for querying, Inspect the view load status.

URL

POST /druid-ext/view-manager/v1/views/{view name}

Required resource

The create view API requires the following resource:

  • {view name}:The view name to create. View names follow the same restrictions as datasources and other Druid objects. View names are case-sensitive.

Payload

The create view takes a JSON payload with the following key:

  • "viewSql": String. The definition of the SQL view.

The following query features are not supported in view definitions:

  • Subqueries of any kind.
  • Joins of any kind.
  • UNION ALL.
  • Aggregations.
  • LIMIT, OFFSET, ORDER BY operations.
  • Queries on anything that is not a base datasource: lookups, INFORMATION_SCHEMA, sys.* tables, or other views.
  • Transforms on the projected columns. Note: transforms within filters are allowed.

Sample payload

{
  "viewSql": "SELECT __time, added, channel, page FROM wikipedia WHERE channel = '#en.wikipedia'"
}

Success response

CodeExample Body
201 Creatednone

Selected error responses

CodeExample Body
400 Bad Request{ "error": "View english already exists" }
400 Bad Request{ "error": "error": "Invalid view definition: SELECT __tXme, added, channel, page FROM wikipedia WHERE channel = '#fr.wikipedia'"
400 Bad Request{"error": "Subqueries cannot be used in view definitions."}

Sample request

curl --location --request POST 'http://localhost:8081/druid-ext/view-manager/v1/views/english' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Basic <encoded authorization string>' \
--data-raw '{
  "viewSql": "SELECT __time, added, channel, page FROM druid.wikipedia WHERE channel = '\''#en.wikipedia'\''"
}'

Learn more

See the following topics for more information:

  • View Manager APIs for a full list of View Manager APIs and links to examples.
  • Row and column level security to learn how to use views to secure data.
  • View Manager for a description of the Imply View Manager.
Last updated on 9/7/2021
← View Manager APIList views →
  • URL
  • Required resource
  • Payload
    • Sample payload
  • Success response
  • Selected error responses
  • Sample request
  • Learn more
2022.04
Key links
Try ImplyApache Druid siteImply GitHub
Get help
Stack OverflowSupportContact us
Learn more
Apache Druid forumsBlog
Copyright © 2022 Imply Data, Inc