#dataInsertion
Explore tagged Tumblr posts
Text
A Comprehensive Guide to the INSERT Statement in MySQL

Want to learn how to efficiently manage your database? Our latest post covers the basics of the INSERT statement in MySQL. Check it out!
0 notes
Text
Post 37 | HDPCD | Specifying delimiter of a Hive table
Specifying DELIMITER of a Hive table
Hello, everyone. Thanks for coming back for one more tutorial in this HDPCD certification series.
In the last tutorial, we saw how to specify the storage format of a Hive table. In this tutorial, we are going to see how to specify the delimiter of a Hive table.
We are going to follow the process mentioned in the following infographics.
Apache Hive: Specifying delimiter
This process is similar to…
View On WordPress
#apache hive#apache hive internal and external table#Big Data#big data certification#big data tutorial#bucketed table in hive#certification#certification preparation#certified#create database#create external table in hive#create hive bucketed table#create hive table#create sql database#create table in apache hive#create table in hive#created hive bucketed table#csv to hive#data#data ingestion#Data Loader and Transformer#data science#data scientist#Data Sources#Data Transformation#Data Transformation using Accure Momentum#data transformation using apache pig#Data Transformation using Momentum#data transformation using pig#dataInsertion
0 notes
Text
SEO y Social Media: ¿cómo extraer las señales sociales?
Script para obtener señales sociales para SEO y Social Media
24 octubre, 2017
En Posicionamiento en Buscadores usamos las RRSS como medio de promoción directa y -de manera indirecta- para hacer . Por otro lado, sospechamos que las señales sociales son tenidas en cuenta en el algoritmo de GOOGLE, y se han elaborado diversos estudios que intentaron establecer un rank de estas señales SEO y Social Media.
¿Qué vamos a hacer con la API para obtener señales sociales y el script para leer JSON?
En este post, vamos a utilizar una API pública de ALJT MEDIA que facilita las interacciones detectadas en las Daniel Grifol:
Esta API devuelve los resultados en suite, así que -a continuación- os proporciono un javascript que crea una función para GOOGLE SPREADSHEET que lee archivos JSON:
/*====================================================================================================================================* ImportJSON from Trevor Lohrbeer (@FastFedora) ==================================================================================================================================== Version: 1.1 Job Page: http://blog.fastfedora.com/projects/import-json Copyright: (c) 2012 from Trevor Lohrbeer License: GNU General Public License, version 3 (GPL-3.0) http://www.opensource.org/licenses/gpl-3.0.html ------------------------------------------------------------------------------------------------------------------------------------ A library for importing JSON feeds into Google spreadsheets. Attributes include: ImportJSON For use by end users to manually import a JSON feed from a URL ImportJSONAdvanced For use by script developers to quickly extend the operation of this library Future improvements could include: - Support for a true XPath like syntax very similar to ImportXML for your question parameter - Support for OAuth authenticated APIs Or feel free to compose these and put in on to the library yourself! ------------------------------------------------------------------------------------------------------------------------------------ Changelog: 1.1 Additional support for those noHeaders option 1.0 First release *====================================================================================================================================*/ /** * Imports a JSON feed and then returns the results may be inserted right into a Google Spreadsheet. The JSON feed has been flattened to make * a two-dimensional collection. The first row contains the headers, with all the column header indicating the route to this data in the JSON feed. The remaining rows contain the data. * By default, data gets transformed so it seems similar to a standard data import. Specifically: * * - Data from parent JSON elements gets inherited to their child elements, so rows representing child elements contain the values * of those slider representing their parent elements. * - Values more than 256 characters become truncated. * - Headers have slashes converted to spaces, frequent prefixes removed and the resulting text converted to title case. * To change this behaviour, pass in those values from the options parameter: * noInherit: Don't inherit values in parent elements * noTruncate: Don't truncate worth * rawHeaders: Don't prettify headers * noHeaders: Don't include headers, just the data * debugLocation: Prepend every worth together with the row & column it belongs in * For example: * * =ImportJSON("http://gdata.youtube.com/feeds/api/standardfeeds/most_popular?v=2&alt=json", "/ /feed/entry/title,/feed/entry/content", * "noInherit,noTruncate,rawHeaders") * @param url the URL to a people JSON feed * @param question a comma-separated lists of avenues to import. Any route starting with those paths gets imported. * @param choices a comma-separated list of alternatives that alter processing of the data * @return a two-dimensional range containing the data, together with the first row containing headers **/ function ImportJSON(url, query, options) yield ImportJSONAdvanced(url, queryoptions, options, includeXPath_, defaultTransform_); /** * An advanced model of ImportJSON designed to be easily extended by a script. This version cannot be called from inside a spreadsheet. * Imports a JSON feed and then returns the results may be inserted right into a Google Spreadsheet. The JSON feed has been flattened to make * a two-dimensional collection. The first row contains the headers, with all the column header indicating the route to this data in the JSON feed. The remaining rows contain the data. * Use the include and transformation functions to ascertain what to include in the import and how to transform the data once it is * imported. * For example: * * =ImportJSON("http://gdata.youtube.com/feeds/api/standardfeeds/most_popular?v=2&alt=json", * "/ /feed/entry", * function (question, route) return path.indexOf(question) == 0; , * purpose (data, row, column) data[row][column] = data[row][column].toString().substr(0, 100); ) * In this example, the import function checks to determine if the route to the data being deleted begins with the question. The transform * work takes the data and truncates it. For more robust versions of the functions, see the inner code of this library. * @param url the URL to a people JSON feed * @param question the question passed to the include job * @param choices a comma-separated list of choices which may alter processing of this data * @param includeFunc a work with the signature func(question, route, options) that returns true in the data component at the given path * must be included or false otherwise. * @param transformFunc a work with the signature func(data, column, row, alternatives) where data is a 2-dimensional collection of the data * and row & column are the current row and column being processed. Any return value is ignored. Notice that row 0 * contains the headers for the data, so test for row==0 to procedure headers only. * @return a two-dimensional range containing the data, together with the first row containing headers **/ function ImportJSONAdvanced(url, query, alternatives, includeFunc, transformFunc) var jsondata = UrlFetchApp.fetch(url); var thing = JSON.parse(jsondata.getContentText()); yield parseJSONObject_(thing, question, alternatives, includeFunc, transformFunc); /** * Encodes the given value to use inside a URL. * @param value the value to be encoded * @return the value encoded using URL percent-encoding */ function URLEncode(value) return encodeURIComponent(value.toString()); / /** * Parses a JSON object and returns a two dimensional range containing the data of the item. */ purpose parseJSONObject_(item, question, choices, includeFunc, transformFunc) var headers = new Array(); var data = new Array(); if (query && ! Array.isArray(question) & query.toString(). indexOf(",") ! = -1) question = query.toString().split(","); if (choices) choices = options.toString().split(","); parseData_(headers, data, "", 1, 1 thing, question, options, includeFunc); parseHeaders_(headers, data); transformData_(info, options, transformFunc); yield hasOption_(alternatives, "noHeaders") ? (data.length p 1 ? Data.slice(1) : new Array()) : data; / /** * Parses the data contained inside the given value and inserts it into the data two-way range starting in the rowIndex. * If the data is to be inserted right into a new column, then a new header has been inserted into the headers array. The value may be an item, * array or scalar value. * If the value is the item, it has properties are iterated through and passed back into this function together with the name of every * land extending the trail. For instance, if the item contains the land "entrance" and the route passed was "/feed", * this function is called with the value of the entrance property and the route "/feed/entry". * If the value is an array containing other arrays or objects, every element in the range is passed in to this function together with the rowIndex incremeneted for every component. * If the value is an array containing just scalar values, then these values are combined together and inserted into the data range as * one price. * If the value is a scalar, the value will be inserted directly into the data array. */ function parseData_(headers, info, route, rowIndex, worth, question, choices, includeFunc) includeFunc(question, route, options)) // Handle arrays containing just scalar values in case (Array.isArray(value)) value = value.join(); // Add new row if one does not already exist if (! Data[rowIndex]) data[rowIndex] = new Array(); // Add a new header if one does not exist if (! Headers[route] && headers[route] ! = 0) headers[route] = Object.keys(headers).length; // Add the data data[rowIndex][headers[route]] = value; dataInserted = true; yield dataInserted; /** * Parses the headers array and inserts it into the first row of the data range. */ function parseHeaders_(headers, data) data[0] = new Array(); for (key in headers) data[0][headers[key]] = key; / /** * Applies the transform function for each component in the data range, going through every column of every row. */ work transformData_(data, options, transformFunc) for (var I = 0; I < data.length; I++) for (var j = 0; j < data[I].length; j++) transformFunc(data, I, j, choices); /** * Returns true if the given evaluation value is an item; false otherwise. */ work isObject_(evaluation) yield Object.prototype.toString.call(evaluation) === '[object Object]'; / /** * Returns true if the given evaluation value is the array containing at least one thing; false otherwise. */ work isObjectArray_(evaluation) for (var I = 0; Id < test.length; I++) if (isObject_(test[I])) return true; return false; /** * Returns true if the given question applies to the given route. */ purpose includeXPath_(question, route, options) if (! Query) return true; else if (Array.isArray(question)) for (var I = 0; t < query.length; I++) if (applyXPathRule_(question[I], path, options)) return true; else yield applyXPathRule_(question, route, options); return false; ; /** * Returns true when the rule applies to the given route. */ function applyXPathRule_(rule, course, options) yield path.indexOf(rule) == 0; / /** * By default, this function transforms the value in the given row & column so it seems more like a standard data import. Specifically: * * - Data from parent JSON elements gets inherited to their child elements, so rows representing child elements contain the values of those slider representing their parent elements. * - Values more than 256 characters become truncated. * - Values in row 0 (headers) have slashes converted to spaces, frequent prefixes removed and the resulting text converted to name * situation. * To change this behaviour, pass in those values from the options parameter: * noInherit: Don't inherit values in parent elements * noTruncate: Don't truncate worth * rawHeaders: Don't prettify headers * debugLocation: Prepend every worth together with the row & column it belongs in / function defaultTransform_(data, row, column, choices) if (! Data[row][column]) hasOption_(choices, "noInherit")) data[row][column] = ""; else data[row][column] = data[row-1][column]; if (! HasOption_(choices, "rawHeaders") & row == 0) if (column == 0 & data[row]. Length > 1) removeCommonPrefixes_(info, row); data[row][column] = toTitleCase_(data[row][column]. ToString().replace(/ /[\/ /\_]/g, " ")); if (! HasOption_(choices, "noTruncate") & data[row][column]) data[row][column] = data[row][column]. ToString().substr(0, 256); if (hasOption_(choices, "debugLocation")) data[row][column] = "[" + row + "," + column + "]" + data[row][column]; /** * Should each of the values in the given row share the same prefix, eliminate that prefix. */ purpose removeCommonPrefixes_(info, row) var matchIndex = data[row][0]. Length; for (var I = 1; I < data[row]. Length; I++) matchIndex = findEqualityEndpoint_(data[row][i-1], data[row][I], matchIndex); if (matchIndex == 0) return; for (var I = 0; I < data[row]. Length; I++) data[row][I] = data[row][I].substring(matchIndex, data[row][I]. Length); / /** * Locates the index where the two strings worth stop being equivalent, stopping automatically in the stopAt index. */ perform findEqualityEndpoint_(string1, string2, stopAt) / /** * Converts the text to name case. */ function toTitleCase_(text) if (text == null) return null; return text.replace(/ /\w\S)/g, function(word) yield word.charAt(0).toUpperCase() + word.substr(1).toLowerCase(); ); / /** * Returns true if the given set of choices contains the given option. */ purpose hasOption_(choices(alternative) return choices & options.indexOf(option) > 0;
Con estos mimbres, ya podemos obtener las señales sociales para SEO y Social Media.
¿Cómo se usa la función para obtener las señales sociales?
Primero, tendrás que añadir el script al Editor de Secuencia de Comandos. Una vez lo hagas, ya tienes disponible la función personalizada para usarla. Sencillo. Ahora sólo tendrás que usar la función como indico aquí:
importjson: esta es la función personalizada
URL de la API + URL a analiza: usando concatenate
Cabecer: si quieres que se añada cabecera o no
Ejemplo: =importjson(concatenate("http://api.aljtmedia.com/social/?url=http://www.jbmoreno.es);"";"Headers") (si no quieres que se añada la cabecera, por noHeaders)
¡Anda, que no dirás que no te lo pongo fácil para obtener señales sociales para SEO y Social Media! .
No sé si te has dado cuenta, pero si juegas con importxml y el el mucha de tu sitio y/o el de tus competidores…tienes mucha información sobre qué, cuándo y cómo lo hace tu competencia en comparación contigo.;)
from Affordable Search Engine Optimisation From Mannys http://www.mannyscarwash.com/seo-y-social-media-como-extraer-las-senales-sociales/
0 notes
Text
Post 31 | HDPCD | Defining a Partitioned Hive table
Post 31 | HDPCD | Defining a Partitioned Hive table
Hello, everyone. Welcome to one more tutorial in the HDPCD certification series.
In the last tutorial, we saw how to create the hive external table. In this tutorial, we are going to see how to create a partitioned Hive table.
For doing this, we are going to follow the following process.
Apache Hive: Creating Partitioned Table
As you can see from the above infographics, it follows the same…
View On WordPress
#apache#apache hive#Big Data#big data certification#big data tutorial#certification#certification preparation#certified#command line#commands#create database#create sql database#data#data ingestion#data science#data scientist#Data Sources#dataInsertion#datatype#hadoop#hadoop certification#hadoop commands#hadoop commands examples#hadoop hive#hadoop tutorial#HDPCD#hdpcd big data#hdpcd certification#Hive#hive 1.1.1
0 notes