AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Administrar bases de datos / Big Data / Gestión de bases de datos HBase
  • Properties specific to hbScanParameter variables
  • Iterating over data with the filter
  • Examples of filters
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
The hbScanParameter type is used to define the parameters for iterating over the records in an HBase database. You can define and change the characteristics of these iteration parameters using different WLanguage properties.
Note: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
Ejemplo
// Connexion
Connexion is hbConnection
Connexion.Server = "MonServeur"
// Description du filtre
MonScan is hbScanParameter
MonScan.Connection = connection
MonScan.Table = "blog"
// Filtre pour toutes les lignes les valeurs des colonnes dont le nom commence par "Titre"
MonScan.Filter = "{ ""type"": ""ColumnPrefixFilter"", ""value"": """ + ...
	Encode("Titre", encodeBASE64) + """ }"
// Parcours selon le filtre et affichage des données filtrées
// La variable de parcours MonRésultat est de type hbRésultatScan
FOR EACH MonRésultat OF MonScan
	Trace("La colonne " + MonRésultat.Colonne.Famille + ":" + ...
		MonRésultat.Colonne.Qualificatif + ...
		" de la ligne " + MonRésultat.Ligne + " vaut " + MonRésultat.Valeur)
END
Propiedades

Properties specific to hbScanParameter variables

The following properties can be used to handle the description of iteration parameters:
Property nameType usedEffect
ColumnArray of hbColumnFamilies or columns (items) found in the result of the iteration.
ConnectionhbConnection variableConnection to the HBase server to be used for the iteration.
EndRowBufferIdentifier of the last row (record) of the iteration. This row will not be included in the iteration.
EndTimestampDateTimeEnd date and time for selecting rows. The iteration will only return the rows containing cells up to this date and time.
FilterCharacter stringFilter that will be applied during the iteration. This filter is in JSON format. The literal values must be encoded in Base64, by using Encode for example.
For more details, see the HBase documentation.
MaxVersionIntegerMaximum number of versions returned for each cell (value of item). Indeed, a history of values is stored in the HBase database for each cell.
StartRowBufferIdentifier of the first row (record) of the iteration. This row will be included in the iteration.
StartTimestampDateTimeStart date and time for selecting rows. The iteration will only return the rows containing cells from this date and time.
TableCharacter stringName of the HBase table to iterate over.
Observaciones

Iterating over data with the filter

To iterate over data with a filter:
  • Define the Filter property of the variable.
  • Use the FOR EACH syntax to initialize the iteration with the filter. The following syntax must be used:
    POUR TOUT <Résultat> SUR <Variable de paramétrage de scan>
    In this syntax, <Result> is a hbScanResult (see the example).

Examples of filters

  1. Filter on column value: MyFamily:MyQualifier = 'Value'.
    MonScan.Filter = ...
    "{" + ...
    """type"": ""SingleColumnValueFilter""," + ...
    """op"": ""EQUAL""," + ...
    """family"": """ + Encode("MaFamille", encodeBASE64) + """," + ...
    """qualifier"": """ + Encode("MonQualificatif", encodeBASE64) + """," + ...
    """latestVersion"": true," + ...
    """comparator"": {" + ...
    		"""type"": ""BinaryComparator""," + ...
    		"""value"": """ + Encode("Valeur", encodeBASE64) + """}" + ...
    "}"
  2. Filter the columns whose name starts with "Title":
    MonScan.Filter = ...
    "{" + ...
      """type"": ""ColumnPrefixFilter""," + ...
      """value"": """ + Encode("Titre", encodeBASE64) + """," + ...
    "}"
  3. Filter the data according to several filters:
    MonScan.Filter = ...
    "{" + ...
      """type"": ""FilterList""," + ...
      """op"": ""MUST_PASS_ALL""," + ...
      """filters"": [" + ...
        "{" + ...
    		filtre1 + ...
        "}," + ...
    	"{" + ...
    		filtre2 + ...
    	"}" + ...
      "]" + ...
    "}"
Versión mínima requerida
  • Versión 21
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 20/09/2024

Señalar un error o enviar una sugerencia | Ayuda local